Saturday, May 9, 2015

parse int ( getFst=parseInt(10.30); )

          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

No comments:

Post a Comment