Login or Sign Up
Logging in...
Remember me
Log in
Or
Sign Up
Forgot password or user name?
Log in with
Search in titles only
Search in Javascript only
Search
Advanced Search
Forums
BYTES
Product Launch
Updates
Developer Toolkit
Member List
Calendar
Today's Posts
Home
Forum
Topic
Javascript
Date validation javascript
Date validation javascript
Collapse
X
Collapse
Posts
Latest Activity
Photos
Page
of
1
Filter
Time
All Time
Today
Last Week
Last Month
Show
All
Discussions only
Photos only
Videos only
Links only
Polls only
Events only
Filtered by:
Clear All
new posts
Previous
template
Next
parshupooja
New Member
Join Date:
Jun 2007
Posts:
159
#1
Date validation javascript
Jan 30 '08, 11:07 PM
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
Last edited by
parshupooja
;
Jan 30 '08, 11:08 PM
.
Reason:
err
r035198x
MVP
Join Date:
Sep 2006
Posts:
13225
#2
Jan 31 '08, 09:44 AM
Originally posted by
parshupooja
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.
Comment
Post
Cancel
parshupooja
New Member
Join Date:
Jun 2007
Posts:
159
#3
Jan 31 '08, 06:00 PM
thanks for replying but thread does not mention about geting future date and I am looking for that.
Originally posted by
r035198x
Have a read at this
thread
which has a link (the one posted by acoder) to all the date functions.
Comment
Post
Cancel
mrhoo
Contributor
Join Date:
Jun 2006
Posts:
428
#4
Jan 31 '08, 07:32 PM
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.
Comment
Post
Cancel
Previous
template
Next
Working...
OK
OK
Cancel
👍
👎
☕
Comment