M
MrHelpMe
I need to create a regular expression for a date field that works only
in the following format MM/DD/YYYY with the / in the format. No other
format can be inputted into the field. I need 2 numbers for MM 2
Numbers for DD and 4 numbers for YYYY. If the users enter 1 number for
month, 1 for day he should get an alert. Thanks.
I have this code and thought it was working but it is not. Any help
would be great. Thanks
Code:
var RegExPattern = /(\d{1,2})\W(\d{1,2})\W(\d{4})/;
in the following format MM/DD/YYYY with the / in the format. No other
format can be inputted into the field. I need 2 numbers for MM 2
Numbers for DD and 4 numbers for YYYY. If the users enter 1 number for
month, 1 for day he should get an alert. Thanks.
I have this code and thought it was working but it is not. Any help
would be great. Thanks
Code:
var RegExPattern = /(\d{1,2})\W(\d{1,2})\W(\d{4})/;