Validate Date
Snippet: var msie = window.document.documentMode; /**** * Checks a controls value to see if it is a Date Value or not * * Parameters: * @cntrl - String; the Control ID value * @success - Function(); The Success function to execute * @fail - Function(); The Fail function to execute */ function ValidDate(cntrl, success, fail) { var valid = false; if (msie !== undefined) { var dtString = cntrlIDs[cntrl].value; var date = new Date(dtString); if (!isNaN(date)) { dtString = dtString.replace(/-/g, "/"); // Assumed pattern: MM/dd/CCYY var parts = dtString.split("/") var dd = parseInt(parts[1], 10); // Day Number var mm = parseInt(parts[0], 10); // Month Number var yr = parseInt(parts[2], 10); // Year Number if (dd === date.getDate()