I'm trying to check if the date entered in datetime
field is a current or a future date. I've tried:
function validations(){
var value=document.getElementById("showdate").value;
if (new Date() > new Date(value)) {
alert("Past date");
}
}
<Form method="post" onsubmit="validations()" autocomplete>
<input type="datetime-local" name="showdate" class="right" required="required" id="showdate">
<input type="submit">
</form>
But this code will work only with the date
field.