Forum Moderators: open

Message Too Old, No Replies

Input Field Background Change in NS4?

         

magic_chef

10:22 pm on Nov 29, 2001 (gmt 0)



I am working on changing the background color of the input fields in a form whenever they have focus. The technique I am using works in both IE5 and Netscape 6/Mozilla, but I am having trouble finding a solution for Netscape 4. Here is a short example to illustrate what I am talking about:

<HTML>
<HEAD>
<TITLE>Highlight</TITLE>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin --

function onFocus( source ) {
source.style.backgroundColor='#FFFFCC';
}

function onBlur( source ) {
source.style.backgroundColor='#FFFFFF';
}

//-- End -->
</SCRIPT>
</HEAD>
<BODY>
<FORM NAME="mainform">
<INPUT TYPE="TEXT" NAME="FIRSTNAME" onfocus="onFocus(this);" onblur="onBlur(this);">First Name
<INPUT TYPE="TEXT" NAME="LASTNAME" onfocus="onFocus(this);" onblur="onBlur(this);">Last Name
</FORM>
</BODY>
</HTML>

I realize the above won't work with Netscape 4 the way it is, but does anyone know if it's possible to achieve this effect at all in NS4?

tedster

5:03 am on Nov 30, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to Webmaster World, magic_chef.

Lots of sites I've seen have some great effect in Explorer and Netscape 6, but they are just plain vanilla in Netscape 4.x. As far as I know, there is no way to address the color of input fields in those browsers.