Page 1 of 1
Neato Input + javascript color "trick"
Posted: Sat Sep 14, 2002 8:20 pm
by phice
Code: Select all
<FORM><INPUT TYPE="Text" NAME="test_Colors" VALUE="Click inside here" onFocus="if (document.all) this.style.backgroundColor='#F0F0F0';" onBlur="if (document.all) this.style.backgroundColor='#FFFFFF';"></FORM>
When a user is input his/her data into text fields (I haven't tested it on anything else), it'll change the background on that certain input tag. Very nice for helping the user know where they're typing..
Posted: Sat Sep 14, 2002 10:26 pm
by phpPete
Clever
Posted: Sun Sep 15, 2002 3:18 am
by Takuma
Cool thing, one thing that you can improve on if the text input background color isn't white it'll be a bit of problem so:-
Code: Select all
<FORM><INPUT TYPE="Text" NAME="test_Colors" VALUE="Click inside here" onFocus="if (document.all) this.style.backgroundColor='#F0F0F0';" onBlur="if (document.all) this.style.backgroundColor='"></FORM>

Posted: Tue Oct 01, 2002 8:46 am
by jamesf4218
It doesn't work on Netscape 4.x
Posted: Tue Oct 01, 2002 8:49 am
by phice
Upgrade.

Posted: Tue Oct 01, 2002 8:54 am
by EvilWalrus
Netscape? That browser is still around? </sarcasm>
Posted: Tue Oct 01, 2002 9:30 am
by jamesf4218
I can't 'upgrade'. I design websites for a living and unfortunately, my log reports still show enough people using N4.x, that I have to program for it. I even try to make the sites work on macs too...
Posted: Tue Oct 01, 2002 9:41 am
by jamesf4218
It doesn't work on Netscape 7.0 or Mozilla either
Posted: Tue Oct 01, 2002 10:00 am
by mikeq
It is probably to do with different DOM in these browsers, the document.all part would need to be changed and maybe this.style.backgroundColor
Posted: Wed Oct 02, 2002 10:46 pm
by phice
EvilWalrus wrote:Netscape? That browser is still around? </sarcasm>
Netscape? What's that?
Posted: Thu Oct 03, 2002 2:33 am
by noguru
I thought PHPers (non-Microsoft programmers in general) prefered Netscape above IE??
Posted: Thu Oct 03, 2002 2:36 am
by twigletmac
I think everybody likes bashing Netscape...
Mac
Posted: Thu Oct 03, 2002 8:50 am
by phice
noguru wrote:I thought PHPers (non-Microsoft programmers in general) prefered Netscape above IE??
Over 85% of the worlds webpages are built on IE first, then changed for netscape.
Posted: Thu Oct 03, 2002 8:56 am
by twigletmac
Coding to standards from the offset does take a lot of the pain out of that though.
Mac
Posted: Thu Oct 03, 2002 11:30 am
by mydimension
for myself, i have learned the hard way. now when i start designing a web page i have both IE an Mozilla open and view my changes in both of them. sure its a pain but it works and my pages are better for it. now if only IE would fix its box model........