Click to See Complete Forum and Search --> : Select Box Validation for N boxes


nik_crash
01-04-2004, 10:37 PM
Hello sir/Ma'am,
I am hoping somebody can help with this:

I have a form with several select boxes which all have the same options (the options represent nba team). I would like to validate this form to require that the same option is not selected on more than one select box?

Thank u very much..

Khalid Ali
01-05-2004, 06:44 AM
here is the logic that I cna comeup verrrry quickly.

use document.getELementsBYTagName("select");

the above will give you an array of all list boxes,
1. now get the first value from the first listbox
2. compare it with all values in all other listboxes one by one,
3. if any entry matched show a message

HINT: may want to use a recursive function