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!

Help Please...I have pbolem with Netscape...

Status
Not open for further replies.

Sreevani

Programmer
Sep 14, 2000
4
US
Hi,
I have posted this Question before...Am working on this since two weeks..
I didn't get the solution..
Am not that much perfect in Java Script...
Can anyone help me?????
My question is below...
****************************************
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
[sig][/sig]
 
Netscape won't allow you to change the color of the textbox. Nor will it allow you to have a read-only text box, short of forcing a blur() during on onfocus().

Welcome to the world of cross-browser development. [sig]<p>nick bulka<br><a href=mailto: > </a><br><a href= </a><br>Get your technical books at Bulka's Books<br>
[/sig]
 
Hi nick,
Thanks for ur response...
Actually this is part of my project...
Any means I have to do this...
Is there any way????
If so please help me...

Thanks,
Sreevani [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top