0

Currently I had problem to validate date of the forms page.

I use date picker form input.

But when user sets date manually (input by keyboard), that date picker still allows wrong dates such as 2016-02-31 (which not existed). Date picker never complains about that.

So how can I validate a date(string) with jQuery or javascript?

2

1 Answer 1

0

2016-02-31 is handled as 2016-03-02, so you just have to compare, whether the date string is equal to the input.

Sign up to request clarification or add additional context in comments.

1 Comment

it's too manual, i think there is better way to validate date.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.