Select Dropdown Option Based on Characters
-
Hi,
I have a dropdown field, fieldname9, with text-value pairs like a-300, b-200, and c-100, and I want to do something based on whether certain characters are present in an option or the vt/text.
I’ve tried:
* if (fieldname9.options[fieldname9.selectedIndex].text.indexOf(“a”) == -1) do something;
* if (fieldname9.text.indexOf(“a”) != -1) do something;
* if (fieldname9.vt.indexOf(“a”) != -1) do something;
* if (fieldname9.value.indexOf(“3”) != -1) do something;
But all of them break the function, and I’ve tested to see if it wasn’t the do something that was the problem.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Select Dropdown Option Based on Characters’ is closed to new replies.