validate Date input using Custom Validator

G

Grey

how to use Custom Validator to valid the date input, such as Feb does not have 30th or April does not have 31st....
I don't want to use Calender control...
 
M

Michael

If you don't "have" to use the custom validator, then why not use a compare
validator? Set the Operator property of the validator to "DataTypeCheck",
and the Type property to "Date".

It's pretty smart too, I just tested it out and it validated (even on client
side), leap years, and everything you mentioned in your post.

--Michael
 
Joined
Feb 1, 2009
Messages
1
Reaction score
0
Change the Operator Property

The operator property for the compare validator must be set to "DataTypeCheck"

Check MSDN for detail msdn.microsoft.com/en-us/library/ad548tzy.aspx
 
Joined
Oct 9, 2012
Messages
1
Reaction score
0
hiii i tried ur way bt i wish to validate only one field of date and if i use compare validator dn what shall i enter in controltovalidate and controltocompare.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top