validation - Validate user input dates are in given date range using javascript -


i new php , javascript. put me in trouble there 2 dates given administration.

var a="24/05/2013"; var b="26/05/2013"; 

assume if user select check in date : 17/05/2013 , check out date : 30/05/2013. can see, selected dates in between above mentioned dates (var , var b). how can validate scenario using javascript.

need support on this.

thanks in advance

try this

function datecheck() {     var fdate = new date("24/05/2013");     var ldate; = new date("26/05/2013");     fdate = date.parse(document.getelementbyid("fdate").value);     ldate = date.parse(document.getelementbyid("ldate").value);      if(fdate <= ldate) {         alert("true");         return true;     }     alert("false");     return false; } 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -