For float number validation ::
var getFst = document.getElementById('onestartTime').value;
var getSnd = document.getElementById('twostartTime').value;
getFst=parseInt(getFst);
getSnd=parseInt(getSnd);
if(getFst==getSnd || getFst>getSnd){
alert("start time must be smaller than endtime");
return false;
}
Example:
here , getFst=10.00
getSnd=10.15
var getFst = document.getElementById('onestartTime').value;
var getSnd = document.getElementById('twostartTime').value;
getFst=parseInt(getFst);
getSnd=parseInt(getSnd);
if(getFst==getSnd || getFst>getSnd){
alert("start time must be smaller than endtime");
return false;
}
Example:
here , getFst=10.00
getSnd=10.15
No comments:
Post a Comment