FastEddie___
asked on
Checking a Drop Down Value against a Javascript Numeric Array List
I would like to check an drop down list value on a form page with a numeric list to see if the value is in the list.
How can this be done via Javascript?
For example:
var myList = new Array(2,3,14,25); // the id list to check against
var fieldVal = thing[thing.selectedIndex] .value; // the numeric selected drop down field value
if(fieldVal == myList[idx])
alert("Yes the drop down value is in my array list");
else
alert("No. the drop down value is not in the array list");
How can this be done via Javascript?
For example:
var myList = new Array(2,3,14,25); // the id list to check against
var fieldVal = thing[thing.selectedIndex]
if(fieldVal == myList[idx])
alert("Yes the drop down value is in my array list");
else
alert("No. the drop down value is not in the array list");
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks
Open in new window