How can i get more option fields selected in my script code ????

var oOption = document.createElement("OPTION")

oOption.value = "1";
oOption.text = "option one";
oOption.selected = true;
oSelect.add(oOption);

oOption.value = "2";
oOption.text = "option two";
oOption.selected = true;
oSelect.add(oOption);

oOption.value = "3";
oOption.text = "option three";
oOption.selected = true;
oSelect.add(oOption);

I only get one option selected but not all three!
i've declared oSelect like this:

var oSelect = document.createElement("select");
oSelect.multiple = true;
oSelect.style.height = '300';
oSelect.attachEvent("onchange", choice)

it's multiple so why don't the three otions highlight ????.

Please who can help me, i'm really stuck!!!!


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories