jeudi 1 mars 2018

How to add field to select time in contact form and it form submission should not be done if the time has already passed

I want to add time to my contact form but whenever user try to book appointment event if time has already passed "ex: suppose today's date is 1/3/18 and current time is 4:30 PM, but even if user tries to select 1:00 PM still form is submitting

How to stop this, here is my code

<div class="col-xs-12">
  <input class="form-control" type="time" placeholder="Select time" id="myTime" name="time" maxlength="50" required/>
</div>

function myFunction() {
  document.getElementById("myTime").value = "22:53:05";
}




Aucun commentaire:

Enregistrer un commentaire