Forum Moderators: open
Here is my implementation. Currently, the script runs, but none of the options have any text in them. Suggestions are appreciated.
Given:
objSelectis the select box whose options I'm messing with;
arrChoiceis an array representing the value and text I want to add to the select (
arrChoice[0]is used by the matching script to screen entries).
var objOption = document.createElement("OPTION");
objSelect.options.add(objOption);
objOption.value = arrChoice[1];
objOption.text = arrChoice[2];
var objOption = new Option(arrChoice[2],arrChoice[1]);
objSelect.options.add(objOption);
// maybe replace line above with
// objSelect.options[objSelect.options.length] = objOption;
Have a go.
Ref: [devguru.com...]