Click here to Skip to main content
15,914,488 members
Please Sign up or sign in to vote.
1.50/5 (2 votes)
See more:
hi can u tell me the code for javascript validation for date format in text box.

Tanks
Sampath.
Posted
Comments
Sandeep Mewara 25-Jan-11 0:16am    
Dude, Google! Make some effort and not just asking for code.

One of the googled results here[^] Google for more and easy ways.
 
Share this answer
 
You would want to use Regular Expressions. The exact expression depends on what format you are enforcing, ie yyyy-mm-dd, m/d/yy, and so on. I usually use http://regexlib.com/[^] as my resource, but a Google search for "regex date validation" will turn up lots of options.
 
Share this answer
 
Google and you will find it.

You may also use ASP.NET CompareValidator[^]. Set the type as date. You will find various examples on the web on how to use it.
 
Share this answer
 

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