Jump to content
xisto Community
Sign in to follow this  
kvarnerexpress

Form Validation

Recommended Posts

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!

Share this post


Link to post
Share on other sites

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 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...

Share this post


Link to post
Share on other sites

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 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?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.