well, here is what i have so far (only for mm/dd/yyyy) Please help me with the other 3 allowable formats :
mm/yyyy
mmm dd, yyyy
yyyy
thanks....
-----
<script>
function validateForm() {
dateCheckMsg = checkDate(document.searchchoice.beg_date_val.value);
if (dateCheckMsg.length > 0) {
alert(dateCheckMsg);
return false;
}
dateCheckMsg = checkDate(document.searchchoice.end_date_val.value);
if (dateCheckMsg.length > 0) {
alert(dateCheckMsg);
return false;
}
}
function checkDate(strDate) {
var strDate;
var strDateArray;
var strDay;
var strMonth;
var strYear;
var intday;
var intMonth;
var intYear;
var dateSeparator=new Array("/",","

;
var errMsg="Please use the correct date format for the Publishing Date\n(e.g. mm/dd/yyyy - 4/12/2001)";
var error=0;
if (strDate.length > 0) {
// Checks if the date uses "/," to separate the month, day, and year.
if (strDate.indexOf(dateSeparator) != -1) {
strDateArray = strDate.split(dateSeparator);
// Checks if the data contains month, day, and year.
if (strDateArray.length != 3) {
return(errMsg);
}
strMonth = strDateArray[0];
strDay = strDateArray[1];
strYear = strDateArray[2];
// Checks if the values are numeric.
if (isNaN(strMonth) || isNaN(strDay) || isNaN(strYear)) {
return("The Publishing Date must be a numeric value\n(e.g. mm/dd/yyyy - 4/12/2001)"

}
intMonth=strMonth;
intDay=strDay;
if (strYear.length < 3) {
intYear=parseInt("20"+strYear);
}
else {
intYear=parseInt(strYear);
}
if (intMonth > 12 || intMonth < 1) {
errMsg+="\n - The Month for the Publishing Date is incorrect.";
error=1;
}
if ((intMonth == 1 || intMonth == 3 || intMonth == 5 || intMonth == 7 || intMonth == 8 || intMonth == 10 || intMonth == 12) && (intDay > 31 || intDay < 1)) {
errMsg+="\n - The Day for the Publishing Date is incorrect.";
error=1;
}
if ((intMonth == 4 || intMonth == 6 || intMonth == 9 || intMonth == 11) && (intday > 30 || intday < 1)) {
errMsg+="\n - The Day for the Publishing Date is incorrect.";
error=1;
}
if (intMonth == 2) {
if (intDay < 1) {
errMsg+="\n - The Day for the Publishing Date is incorrect.";
error=1;
}
if (LeapYear(intYear) == true) {
if (intday > 29) {
errMsg+="\n - The Day for the Publishing Date is incorrect.";
error=1;
}
}
else {
if (intday > 28) {
errMsg+="\n - The Day for the Publishing Date is incorrect.";
error=1;
}
}
}
if (error == 1) {
return(errMsg);
}
}
// Returns an error if date does not user "/" to separate the month, day, and year.
else {
return(errMsg);
}
}
return(""

;
}
</script>
<FORM name=searchchoice METHOD="post" ACTION="/search" onsubmit="return validateForm();">
<INPUT type="text" name="beg_date_val" size="12" maxlength="12">
and <INPUT type="text" name="end_date_val" size="12" maxlength="12">
</form>