Click to See Complete Forum and Search --> : Select form field won't work in Netscape


rhfish
07-07-2003, 10:51 AM
Can any one tell me why the "onChange" event will not work in Netscape 7.0, 7.1 etc.? It won't work even if I place an onClick event for a GO button.

<form name="topics">
<select size="1" name="slideSelect" onChange="changePix(this.form.slideSelect)">
<option value="max">Intro</option>
<option value="Topic1">Topic 1</option>
<option value="Topic2">Topic 2</option>
<option value="Topic3">Topic 3</option>
<option value="Topic4">Topic 4/option>
<option value="Topic5">Topic 5</option>
</select>
</form>

requestcode
07-07-2003, 11:37 AM
With Netscape browsers you need to also use the selectedIndex to grab the value of the option tag that was selected. Try changing the onChange to this:
select size="1" name="slideSelect" onChange="changePix(this.options[this.selectedIndex].value)">

The above will also work with IE.

rhfish
07-07-2003, 11:41 AM
I do what you suggest in the changePix function. However, using Netscape it never gets to the function in the first place.

requestcode
07-07-2003, 01:36 PM
Are you getting an error? A link to your code would be helpful. It is possible that the function was written with IE in mind only.

rhfish
07-07-2003, 03:01 PM
Your suggestion did work in both NS and IE as you said. In NS the onChange event would not execute the function at all (no error, no nothing) but it worked fine in IE.

Thanks for your help.

R