function validate() { if(!checkDate( document.form1.txtFdate.value ) ) { alert("Invalid Date"); document.getElementById("txtFdate").focus(); return false; } if(!checkDate( document.form1.txtTdate.value ) ) { alert("Invalid Date"); document.getElementById("txtTdate").focus(); return false; } var dateString=document.form1.txtFdate.value; var Fdate = (dateString.substring(6,10))+(dateString.substring(3,5))+(dateString.substring(0,2)); dateString=document.form1.txtTdate.value; var Tdate = (dateString.substring(6,10))+(dateString.substring(3,5))+(dateString.substring(0,2)); if(parseInt(Tdate,10)<parseInt(Fdate,10)) { alert("To Date Cannot Be Less Than From Date"); document.getElementById("txtTdate").focus(); return false; } if((parseInt(Tdate,10)-parseInt(Fdate,10))>6) { alert("Difference Between From and To Date Cannot Be More than 6 Days"); document.getElementById("txtTdate").focus(); return false; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)