[Solved] how to fix the validation for date


You are comparing string with a string

Try like this

var userDate=new Date(x);
var currDate=new Date()
if (+userDate <= +currDate ){ // + will convert date into miliseconds
    alert("Please select a higher date!");
    return false;
}

2

solved how to fix the validation for date