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="GENERATOR" Content="Microsoft Visual Studio 6.0">
<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 = "#FFFFFF"
}
else
{
t.readOnly = true;
t.style.backgroundColor = "#999999"
}
}
//-->
</SCRIPT>
</HEAD>
<BODY>
<P>
<SELECT Name="name_of_document" id="name_of_document_select_box" onchange="selectitem_change_w_other(name_of_document_select_box, name_of_document_text_box)">
<OPTION Value="">--</OPTION><OPTION Value="Internet and Electronic Use">Internet and Electronic Use</OPTION>
<OPTION Value="Use of Technology and the Internet">Use of Technology and the Internet</OPTION>
<OPTION Value="Electronic Workplace Policy">Electronic Workplace Policy</OPTION>
<OPTION Value="Use of Equipment">Use of Equipment</OPTION>
<OPTION Value="Other: Please Enter Below">Other: Please Enter Below</OPTION></SELECT>
<BR><input type=text name="name_of_document_text_box" id="name_of_document_text_box" size=40 maxlength=100 style="background-color: #999999;" onfocus="selectitem_change_w_other(name_of_document_select_box, name_of_document_text_box)">
</p>
</BODY>
</HTML>
**********************************************************
Thanks,
Sreevani
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="GENERATOR" Content="Microsoft Visual Studio 6.0">
<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 = "#FFFFFF"
}
else
{
t.readOnly = true;
t.style.backgroundColor = "#999999"
}
}
//-->
</SCRIPT>
</HEAD>
<BODY>
<P>
<SELECT Name="name_of_document" id="name_of_document_select_box" onchange="selectitem_change_w_other(name_of_document_select_box, name_of_document_text_box)">
<OPTION Value="">--</OPTION><OPTION Value="Internet and Electronic Use">Internet and Electronic Use</OPTION>
<OPTION Value="Use of Technology and the Internet">Use of Technology and the Internet</OPTION>
<OPTION Value="Electronic Workplace Policy">Electronic Workplace Policy</OPTION>
<OPTION Value="Use of Equipment">Use of Equipment</OPTION>
<OPTION Value="Other: Please Enter Below">Other: Please Enter Below</OPTION></SELECT>
<BR><input type=text name="name_of_document_text_box" id="name_of_document_text_box" size=40 maxlength=100 style="background-color: #999999;" onfocus="selectitem_change_w_other(name_of_document_select_box, name_of_document_text_box)">
</p>
</BODY>
</HTML>
**********************************************************
Thanks,
Sreevani