Click here to Skip to main content
15,911,132 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello guys,

There are two textbox

1.StartTime
2.EndTime
I have to make employee work form
how much work one employee did in one day dynamically I have to generate rows and put the time(define its range)
What I have to check that if anybody put 9:30 to 10:30 time so nobody put 9:45 in next Row it should confer of not accepting kindly tell me what code or validation I should use to do this task

Please give me the code or script
Posted
Comments
BillWoodruff 5-Nov-11 10:31am    
And the context here is: a WebForm with some kind of GridView in ASP.NET ? or a DataGrid in WinForms ?

Do you want your validation to "enforce" an absolute sequence of non-overlapping time intervals: for example, I enter 9-10AM first, then I try to enter 8:30-8:50AM: would that need to be blocked ?

1 solution

I give you an idea.Do this in javascript
1) create an Array of Start Time - End Time entered in textbox
eg. Start Time-9:30 And End Time-10:30
Start Time-10:30 And End Time-11:30 and so on
2) validate Entered time as below
Start Time < Enter Time AND Enter Time < End Time - Invalid
loop through Array
eg. 9:30 < 9:45 && 9:45 < 10:30 - Invalid
 
Share this answer
 
Comments
Prashant Srivastava LKO 7-Nov-11 1:25am    
No I have to take the field startTime and EndTime what is the need to take entertime.

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