could you provide me how to check thanks
Main Topics
Browse All TopicsI need validation javscript which check user enter dd-mmm-yyyy.
thanks
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Example:
<script language="JavaScript">
function checkdate (input_date)
{
var re_date = /(\d+)\-(\d+)\-(\d+)/;
if (!re_date.exec(input_date)
return alert("Invalid Date Format: "+ input_date);
return (new Date(input_date));
}
</script>
<form action="action_page" method="post" name="form1" onSubmit="return checkdate(input_date.value
<input type="text" name="input_date">
<input type="submit" name="Submit" value="Submit">
</form>
Run this code and observe what happens.
Best wishes!!!
Entrance2002 :)
Try this one, too:
http://www.smartwebby.com/
By the way, Just to remind you.
You even don't accept any answers since March 09, 2003.
Are you really interested in this site to ask for help?
Maybe you shouldn't have disregards all our ideas that might help you for future use. You should update from time to time regarding your problems that you have posted.
Since, we are willing to help people like you don't make us expect for nothing.
OK.
Peace... !!! :)
try this code
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
// Checks for the following valid date formats:
// MM/DD/YY MM/DD/YYYY MM-DD-YY MM-DD-YYYY
var datePat = /^(\d{1,2})(\/|-)(\d{1,2})
var matchArray = dateStr.match(datePat); // is the format ok?
if (matchArray == null) {
alert(dateStr + " Date is not in a valid format.")
return false;
}
month = matchArray[1]; // parse date into variables
day = matchArray[3];
year = matchArray[4];
if (month < 1 || month > 12) { // check month range
alert("Month must be between 1 and 12.");
return false;
}
if (day < 1 || day > 31) {
alert("Day must be between 1 and 31.");
return false;
}
if ((month==4 || month==6 || month==9 || month==11) && day==31) {
alert("Month "+month+" doesn't have 31 days!")
return false;
}
if (month == 2) { // check for february 29th
var isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));
if (day>29 || (day==29 && !isleap)) {
alert("February " + year + " doesn't have " + day + " days!");
return false;
}
}
return true;
}
// End -->
</script>
K'Regards
Jayesh
Business Accounts
Answer for Membership
by: entrance2002Posted on 2003-04-13 at 18:34:38ID: 8324056
Try this one:
)
function checkdate (input_date)
{
var re_date = /(\d+)\-(\d+)\-(\d+)/;
if (!re_date.exec(input_date)
return alert("Invalid Date Format: "+ input_date);
return (new Date(input_date));
}
Hope it helps.
GOODLUCK!
Entrance2002 :)