I am having problems with this instruction in netscape
cel.options[1].selected=true;
where cel is a dropdown with many items in it... why!?!
Printable View
I am having problems with this instruction in netscape
cel.options[1].selected=true;
where cel is a dropdown with many items in it... why!?!
how can I select an item from a dropdown with javascript that is valid in netscape...??!?!
Which version of NS are you talking about? This works in 6.2:
Code:<form id="form1" action="#">
<select id="select1">
<option>Option 1</option>
<option>Option 2</option>
<option>Option 3</option>
<option>Option 4</option>
<option>Option 5</option>
</select>
<input type="button" value="Select"
onclick="document.forms['form1'].select1.options[3].selected = true;" />
</form>
Buddy, give us a ring if you ever DON'T have problems. :DQuote:
Originally posted by Andreex
I am having problems ... in netscape
But the real reason I posted... I heard its better to use NAME in NS... not sure where I heard it though, probably wrong :D
haha... I know Netscape is a pain.... but I will try the code Rick Bull posted to see if it works
Version 6+ of NS are usually a lot better than IE for doing things with (for example) CSS that would otherwise take ages doing with JavaScript in IE :D