I have to restrict users so that they can enter only date in these formats:
010611
01062011
01-06-2011
01/06/2011
01jun11
01jun2011
Is there any API function for it, or should I use a regular expression?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I had the same requirement. I solved it by using the input mask plugin for jQuery.
Here you can define the proper format via a regular expression.