Hello,

does anyone know how i can validate a date field using javascript. The field is a text field that accepts a date in the format yyyy-mm-dd.

i appreciate your help.
Thanks.

Recommended Answers

All 3 Replies

find here the regular expression...
if you are still not able to figure it out..let me know.....

/^[0-9]{4}\-[0-9]{2}\-[0-9]{2}$/

hello can any one tell me how to validate date and time. i am selecting date and time from calendar window .then how should i validate it .

If you are selecting it from a Calendar widget, won't it be automatically validated? Of course you can't pick out '123/123/123' from it, can you?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.