I have a form that sends the values entered in input
to another page. I want to make a validation between the inputs, if one number is greater than another, and if not, do not go to the second page and warn with alert
.
Here is my HTML code:
<form action="_graphes.php" method="post">
<input type="time" id="time_debut" name="time_debut" step="1" value=''>
<input type="time" id="time_fin" name="time_fin" step="1" value='' >
<input id=btn type=submit name=go value=ok>
</form>
And the javascript:
if(document.getElementById("time_debut").value > document.getElementById("time_fin").value){
alert("Maior");
}