Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Overlapping in timecard calculatoins

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi,

I am working on making a timecard that is going to be submitted online. I have everything ready to go with the exception that they want to make sure that no one is entering times that are overlapping. I am really new to all of this, so any help would be greatly appreciated. I have been told that I may have to use an array or something like that. I have 28 times that need to be compared. There are 7 forms on each page and two start/stop times on each form.
TIA
 
You could place the start and stop times in two identical lists on each form (both contain the same times in the same order).

For the first test, compare the selectedIndex property of each of the pairs of lists (if the selectedIndex for the start time is greater than the selectedIndex for the stop time, the selections for that form are invalid).

I assume that the 7 forms represent the 7 days of the week. If this is the case, comparing the selections of the forms' lists against each other isn't necessary as you already know which date they refer to and overlapping times isn't an issue from day to day.

Of course, I'm assuming some things here about how you have this set up. If this doesn't agree with your problem, post some code or the URL.

Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top