Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Netscape Returns "NULL" 1

Status
Not open for further replies.

wood

MIS
Aug 3, 2000
139
CA
I am trying to display the value of a select box.

My javascript is as below:
...
alert(formobj.elements[2].value)
...

This works with IE. It displays "2000". With Netscape it displays "NULL".

I have also tried...

alert(document.formName.FieldName.value)


I am trying to make this cross browser compatible. Does anyone have any suggestions?? Any help is appreciated. [sig][/sig]
 
look at the this.value thread a few lines down, or try referencing like this

document.formName.listboxname.options[document.formName.listboxname.selectedIndex].value [sig]<p>ray<br><a href=mailto:rheindl@bju.edu>rheindl@bju.edu</a><br><a href= > </a><br> [/sig]
 
Thanks for your tip. I did look at the &quot;this.value&quot; thread below, but it did not help.

However, your second suggestion did.

Thank you! |-0 [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top