I have a form with two input fields.
<input type="text" id="first" value="">
<input type="text" id="second" value="">
I have tried this but no success
<script>
$(function(){
var fst=$("#first").val();
var sec=$("#second").val();
if (sec>fst) {
alert("Second value should less than first value");
return true;
}
})
</script>
How to allow only second input values are only numbers and also less than the first input