By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,165 Members | 850 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,165 IT Pros & Developers. It's quick & easy.

Date validation javascript

parshupooja
100+
P: 159
I want to validate a date via javascript. Date should not be in future and date should not me more than seven days old.

Any idea? help
Jan 30 '08 #1
Share this Question
Share on Google+
3 Replies


10K+
P: 13,264
I want to validate a date via javascript. Date should not be in future and date should not me more than seven days old.

Any idea? help
Have a read at this thread which has a link (the one posted by acoder) to all the date functions.
Jan 31 '08 #2

parshupooja
100+
P: 159
thanks for replying but thread does not mention about geting future date and I am looking for that.

Have a read at this thread which has a link (the one posted by acoder) to all the date functions.
Jan 31 '08 #3

100+
P: 428
If the only possible dates are the previous seven days, just offer 7 choices in a radio or select menu.

Start with today's date, which you get from new Date(), and use the .setDate() method on that date to get the previous 6 days.

Validating user input dates is hard- avoid it by giving the user only valid choices.
Jan 31 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.