I have javascript validating a date. If I validate 1 date its ok but if I add another date onto the table, it doesnt work? How can I make it validate a array of motors[]. Thanks
EDIT
Thanks
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.
If you want to use regex you can validate the date string in one step with the following:
Basically it matches the dates from
01/01/1970to12/31/2038then pass your array of dates to this function:
See this demo.
Alternatively you can use
Date.parse()and check the return value.