var chkdate = document.getElementById("date_slot").value if(document.getElementById("date_slot").value == "") { alert("Please enter the Date..!!") hh.date_slot.focus(); return false; } else if(!chkdate.match(/^(0[1-9]|[12][0-9]|3[01])[\- \/.](?:(0[1-9]|1[012])[\- \/.](19|20)[0-9]{2})$/)) { alert('date format is wrong'); hh.date_slot.focus(); return false; }
<tr> <td >Date For Demo :<span class="required" style="color:#64a34f;">*</span> </td> <td > <input id="date_slot" name="date" type="text" style="width:150px;"/> (DD/MM/YY) </td> </tr>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)