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!

this.value in Netscape?

Status
Not open for further replies.

TAMSIN

Programmer
Sep 6, 2000
31
GB
Hi!
I wrote a validation script, which worked fine in IE, then tried it in Netscape & it all fell apart... I think I've narrowed it down to the fact that I was passing this.value to my validation function. In IE that was fine, but in Netscape it seems to pass null. I tried the following, putting alert instead of my function, & in IE I get e.g. "2000" popping up in an alert, but in Netscape I get Null. Am I missing something really basic here?
Thanks!

<SELECT NAME=&quot;order_no&quot; onChange=&quot;alert(this.value)&quot;>
<OPTION value=&quot;2000&quot;>2000</OPTION>
<OPTION value=&quot;2001&quot;>2001</OPTION>
<OPTION value=&quot;2002&quot;>2002</OPTION>
</SELECT> [sig][/sig]
 
you need to reference the object's value that is selected like this:

this.options[this.selectedIndex].value [sig]<p>ray<br><a href=mailto:rheindl@bju.edu>rheindl@bju.edu</a><br><a href= > </a><br> [/sig]
 
That fixed it. Thank you!
Tamsin [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top