is it possible to change the background colour of a txt box

liunx

Guest
I have a txt box, when the user clicks it, I want the colour to change, how is it done? <br />
heres my code that dont work!:<br />
<input name="Name" value="<?php echo "$fsname";?>" onMouseDown="value='', bgcolor='#ff3118'" ><br />
bgcolor probably isnt right!<!--content--><input type=text onFocus="this.style.backgroundColor='#AAAAFF';"><br />
<br />
<br />
That will change the background color of the text field when it receives focus. You can use onMouseDown instead if you want. If you do this, I recommend setting an onBlur to return the background back to white when the user leaves that field. Otherwise it will just stay blue (or whatever color you set it to). To change it back to white, do this:<br />
<br />
<br />
<input type=text<br />
onFocus="this.style.backgroundColor='#AAAAFF';"<br />
onBlur="this.style.backgroundColor='#FFFFFF';"><br />
<br />
<br />
As for your PHP part in the value, I'm not familiar with PHP, so I don't know if that part is valid.<!--content-->
 
Back
Top