Click to See Complete Forum and Search --> : Looped validation


Nik36
12-07-2006, 08:47 AM
I have an ASP repeat region that generates drop down menus for each record
like this:

myOrder1
myOrder2
myOrder3

Each one of these menus has a numeric value read from the specific database record.

I want to validate these drop downs so the menus are not permitted to have the same value.

I can't get the javascript to return each of the myOrder instances.
The only thing I could do successfully was to write out all of the form element names and values but I need to focus on the drop downs and compare their values like this:

if(myOrder+i == myOrder+i){
alert ("Duplicate Value!");
}

I have tried a for loop but I just get an undefined value for myOrder+i

Any ideas?