Click here to Skip to main content
16,020,519 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
could anyone help me out in getting validation expression for a text box academic year
of format:2011-2012(difference should be only 1) values in between 1989 to 2999?
thanq
Posted
Updated 7-Mar-12 0:03am
v2

1 solution

1. you can use the validation expression to check for dates:

<br />
var Year="^[0-9]{4}$";<br />


as for the range i think you should use a range validater or custom validater to check for that.

in case you want the range like value like 2011-2012 then regex will be:

<br />
var Year="^[0-9-]{9}$";<br />
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900