|
|
|
|
![]() ![]() |
Mar 17 2006, 09:18 PM
Post
#1
|
|
|
Super Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 407 Joined: 13-December 04 Member No.: 2,696 |
I have a timesheet type form that has 40 different row - each row has two dropdowns, one for a project and one for a task, and a dropdown box for each day of the week. Once a project and task has been selected, hours spent on that task each day of the week are entered into the text boxes.
What I would ideally like to do is, before I send this page for processing on my asp page (which involves saving the data back to the database), I'd like to check whether or not the user has entered the same project/task combination on multiple rows.....the dropdowns on each row are named project1-project40, task1-task40, mon1-mon40 etc. I'm using VBScript for the server side scripting, but I'll happily incorporate a section of Javascript code if that will offer me a simpler solution. Any ideas or suggestions are more than welcome here! |
|
|
|
Mar 17 2006, 11:49 PM
Post
#2
|
|
|
Super Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 276 Joined: 4-August 05 Member No.: 10,273 |
here is the pseudocode, you do the implementation:
for i from 0 to 40 do { no.of.matches=0; for j from 0 to 40 do { compare project/task[i] to project/task[j] if it is a match increase no.of.matches for 1 } } if no.of.matches>40 report error //only compared to ifself sorry, can't do any better, I forgot a lot of those things, since I do someting else now. I hope you can get something out of this... |
|
|
|
Mar 18 2006, 06:22 AM
Post
#3
|
|
|
Trap Grand Marshal Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 1,203 Joined: 25-March 05 Member No.: 4,883 |
Hey kvarnerexpress, I guess we'll get a clearer picture of what you are trying to ask for when you post your codes as well. Because there's different methods of doing, having your codes as reference will solve your problem faster. Your task should be rather simple to validate with just Javascript. I may be able to help you if you provide the codes of your work.
for i from 0 to 40 do { no.of.matches=0; for j from 0 to 40 do { compare project/task[i] to project/task[j] if it is a match increase no.of.matches for 1 } } Firstly, please place your codes in the [-CODE-] [-/CODE-] tags. Secondly, you codes seemed pretty weird. Or is it actually not a code? |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 11th October 2008 - 07:45 AM |