/    Sign up×
Community /Pin to ProfileBookmark

Date Validation thru Java Script

Does anybody know a really slick way to validate a 8 digit date.
mo da cy yr
Format being- 02 14 20 04

Any help would be appreciated.

Thanks

Clyde

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@VladdyFeb 12.2004 — After you change format to something more conventional....

if(isNaN((new Date(dateString)).valueOf()))

return false;
Copy linkTweet thisAlerts:
@clydeauthorFeb 12.2004 — Vladdy

Thanks for your response

The script that you posted will check for valid numeric, but it will not flag 06312004 as an invalid date, am I correct.

I guess maybe I am looking for to much. I need to do full date validation.

Any suggestions

Thanks

Clyde
Copy linkTweet thisAlerts:
@oleragFeb 12.2004 — You can check-out this [URL=http://forums.webdeveloper.com/showthread.php?threadid=26410&highlight=date]thread[/URL] to see if it meets your requirments.

Note that the format for this script is MM/DD/YYYY so you'd

need to combine your CY/YY fields into one. I believe the

RegExp uses either "/" or "-" delimiters between fields.
Copy linkTweet thisAlerts:
@clydeauthorFeb 19.2004 — Thanks for the reply
×

Success!

Help @clyde spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...