Click here to Skip to main content
15,885,980 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hai

Actually i have a grid view with some textboxes, there i have to enter time in one textbox if i give time in text box it should take time in ascending order only. for eg: 1st time if i give 8:30 and next time if i give 8:20 it should not accept it, it should take time above 8:30 and after 08:30 values.
it should not accept time below 08:30.

Thanks in advance
Posted
Updated 29-Apr-13 21:51pm
v2
Comments
Thanks7872 30-Apr-13 3:13am    
can you elaborate more on this question?its not clear what you want to do?provide some example if any.
Swetha Bisa 30-Apr-13 3:21am    
actually i have a grid view with some textboxes, there i have to enter time in one textbox if i give time in text box it should take time in ascending order only. for eg: 1st time if i give 8:30 and next time if i give 8:20 it should take 8:30 and after 08:30 values,
it should not accept below it
Jithin Geroge 30-Apr-13 3:15am    
Please provide some more detail about ur question ... Not getting clear idea...
Swetha Bisa 30-Apr-13 3:48am    
actually i have a grid view with some textboxes, there i have to enter time in one textbox if i give time in text box it should take time in ascending order only. for eg: 1st time if i give 8:30 and next time if i give 8:20 it should take 8:30 and after 08:30 values,
it should not accept below it
Roshan Samrit 30-Apr-13 4:05am    
on blur event of textbox u can call function and hold Previous values in temp variable so that you can compare both values.

1 solution

Hi,

Please check this code:-

JavaScript
<pre><script type="text/javascript">
    function checkTime(id) {
        
        var val = $('#'+id).val();
        var t = $('#txtTime1').val();
        if (val != "") {
            if (val > t) {

            }
            else {
                alert('Please check your value');
            }
        }     
    }

   
</script>

<input type="text" id="txtTime1" />
<input type="text" id="txtTime2" onblur="checkTime(this.id)" />
<input type="text" id="txtTime3" onblur="checkTime(this.id)" />
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900