would need help on the statement below:
its a form submission for date and its not a mandatory field.
how can i submit without any value ? because currently i can't submit the form without value in date field.
Thank you
function ABC_StringIsDateFormatddMMyyyy(str) {
if (str.length != 8) {
return false;
}
var strYear = str.substring(4, 8);
var strMonth = str.substring(2, 4);
var strDay = str.substring(0, 2);
if (isNaN(strYear)) {
return false;
}
if (isNaN(strMonth)) {
return false;
}
if (isNaN(strDay)) {
return false;
}
var d = new Date();
d.setFullYear(strYear, parseInt(strMonth) - 1, strDay);
strYear = d.getFullYear();
strMonth = d.getMonth() + 1;
strMonth = "00" + strMonth;
strMonth = strMonth.substring(strMonth.length - 2, strMonth.length);
strDay = d.getDate();
strDay = "00" + strDay;
strDay = strDay.substring(strDay.length - 2, strDay.length);
var tmp = strDay + strMonth + strYear;
if (str != tmp) {
return false;
}
return true;
}