Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET
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 29-Apr-13 22:05pm
Edited 29-Apr-13 22:51pm
v2
Comments
Rohan Leuva at 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 at 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 at 30-Apr-13 3:15am
   
Please provide some more detail about ur question ... Not getting clear idea...
Swetha Bisa at 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 at 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.
madhav_jain at 30-Apr-13 5:25am
   
I think you have some set of textboxes and in one text box if you give time 8:30 than in next text box user should allow only take 8:30 and after 08:30 values right
Swetha Bisa at 30-Apr-13 5:46am
   
yes you are corrrect...

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Hi,
 
Please check this code:-
 
<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)" />
 

  Permalink  

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

  Print Answers RSS
0 OriginalGriff 195
1 ProgramFOX 130
2 Maciej Los 105
3 Sergey Alexandrovich Kryukov 105
4 Afzaal Ahmad Zeeshan 82
0 OriginalGriff 6,564
1 Sergey Alexandrovich Kryukov 6,048
2 DamithSL 5,228
3 Manas Bhardwaj 4,717
4 Maciej Los 4,150


Advertise | Privacy | Mobile
Web03 | 2.8.1411022.1 | Last Updated 30 Apr 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100