From b5db2ed3b9089945be3f7106c8ab524bdb3c6347 Mon Sep 17 00:00:00 2001 From: velz2020 Date: Wed, 7 Feb 2018 19:53:30 +0530 Subject: [PATCH] TIME VALIDATION ISSUEFIXED --- application/views/hourly_batch_card.php | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/application/views/hourly_batch_card.php b/application/views/hourly_batch_card.php index e7cdeeda..b2afe3d4 100755 --- a/application/views/hourly_batch_card.php +++ b/application/views/hourly_batch_card.php @@ -390,7 +390,7 @@ if(stop.length != 5){ start = start.split(":"); stop = stop.split(":"); - if(isNaN(start[0]) || isNaN(start[1]) ) + if(isNaN(start[0]) || isNaN(start[1]) || parseFloat(start[0]) > 24 || parseFloat(start[1]) > 60) { alert("please Enter Valid Time"); document.getElementById('auto_start').value = ''; @@ -401,7 +401,7 @@ if(stop.length != 5){ } - if(isNaN(stop[0])) + if(isNaN(stop[0]) || isNaN(stop[1]) || parseFloat(stop[0]) > 24 || parseFloat(stop[1]) > 60) { alert("please Enter Valid Time"); document.getElementById('auto_stop').value = ''; @@ -412,16 +412,7 @@ if(stop.length != 5){ } - if(isNaN(start[0])) - { - alert("please Enter Valid Time"); - document.getElementById('auto_start').value = ''; - setTimeout(function(){ - $('#auto_start').focus();},0 - ); - return false; - - } + if((start[0] > stop[0])) { @@ -433,16 +424,6 @@ if(stop.length != 5){ ); return false; } - - if((start[1] > stop[1])) - { - alert('Enter Valid Time'); - document.getElementById('auto_stop').value = ''; - setTimeout(function(){ - $('#auto_stop').focus();},0 - ); - return false; - } var h = parseFloat(stop[0]) - parseFloat(start[0]); var m = parseFloat(stop[1]) - parseFloat(start[1]);