View Single Post
  #9 (permalink)  
Old December 10th, 2003, 11:04 PM
rodmcleay rodmcleay is offline
Friend of Wrox
Points: 2,376, Level: 20
Points: 2,376, Level: 20 Points: 2,376, Level: 20 Points: 2,376, Level: 20
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: , , Australia.
Posts: 596
Thanks: 1
Thanked 3 Times in 3 Posts
Default

This was the effect I was after
Code:
    <HTML>
       <HEAD>
    <SCRIPT LANGUAGE=JavaScript>
          function changeColor(box)
          {
                document.all.form1.txt1.style.background = '#eeeeee';
                document.all.form1.txt2.style.background = '#eeeeee';
                document.all.form1.txt3.style.background = '#eeeeee';        
                document.all[box].style.background = '#ffffff';    
          }
    </SCRIPT>
    </HEAD>
    <BODY>
    <FORM NAME=form1>      
           <input onfocus="changeColor('txt1');" name="txt1" style="background-color:#eeeeee" id="txt1" value="Hello" ><br>
           <input onfocus="changeColor('txt2');" name="txt2" style="background-color:#eeeeee" id="txt2" value="Hello" ><br>
           <input onfocus="changeColor('txt3');" name="txt3" style="background-color:#eeeeee" id="txt3" value="Hello" ><br>
    </FORM>
    </BODY>
    </HTML>

======================================
They say, best men are moulded out of faults,
And, for the most, become much more the better
For being a little bad.
======================================
Reply With Quote