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!

Onchange problem with Netscape

Status
Not open for further replies.

Sreevani

Programmer
Sep 14, 2000
4
US
Hi,
I have a select box and Textbox....
I want make the text box Readonly and with Grey color if the option value in the SelectBox is not Other...
My code is working fine with Ie and its not working in Netscape..
Here is my code below..
Can anyone help me????

****************************************
<HTML>
<HEAD>
<META NAME=&quot;GENERATOR&quot; Content=&quot;Microsoft Visual Studio 6.0&quot;>
<TITLE></TITLE>
<SCRIPT LANGUAGE=javascript>
<!--

function selectitem_change_w_other(s, t)
{
if ((s.selectedIndex + 1) == s.options.length)
{
t.readOnly = false;
t.style.backgroundColor = &quot;#FFFFFF&quot;
}
else
{
t.readOnly = true;
t.style.backgroundColor = &quot;#999999&quot;
}
}

//-->
</SCRIPT>
</HEAD>
<BODY>
<P>
<SELECT Name=&quot;name_of_document&quot; id=&quot;name_of_document_select_box&quot; onchange=&quot;selectitem_change_w_other(name_of_document_select_box, name_of_document_text_box)&quot;>
<OPTION Value=&quot;&quot;>--</OPTION><OPTION Value=&quot;Internet and Electronic Use&quot;>Internet and Electronic Use</OPTION>
<OPTION Value=&quot;Use of Technology and the Internet&quot;>Use of Technology and the Internet</OPTION>
<OPTION Value=&quot;Electronic Workplace Policy&quot;>Electronic Workplace Policy</OPTION>
<OPTION Value=&quot;Use of Equipment&quot;>Use of Equipment</OPTION>
<OPTION Value=&quot;Other: Please Enter Below&quot;>Other: Please Enter Below</OPTION></SELECT>
<BR><input type=text name=&quot;name_of_document_text_box&quot; id=&quot;name_of_document_text_box&quot; size=40 maxlength=100 style=&quot;background-color: #999999;&quot; onfocus=&quot;selectitem_change_w_other(name_of_document_select_box, name_of_document_text_box)&quot;>
</p>
</BODY>
</HTML>
**********************************************************
Thanks,
Sreevani
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top