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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

color of textfield

Status
Not open for further replies.

KryptoS

Programmer
Feb 7, 2001
240
BE
Hey,

is there a way to change the textcolor of an input field if the field is disabled? I know you can change the background color of the field, but the textcolor is always gray ... is there now way to change that color?
 
you can use the style property:

<input type=text style=&quot;text-colout: red;&quot;>

you can completely customise anything with this..

--BB
 
1. it has to be with javascript eg. document.form.elements....

2. It also doesn't work because the field is disabled ... or am I wrong?
 
sorry... there was a typo above... should read:
<input type=text style=&quot;text-color: red;&quot;>

This is not javascript, it is style sheets

 
yep I know that that was wrong :) but it still doesn't solve my problem ... but thanx anyway
 
<input type=&quot;text&quot; style=&quot;color: red&quot; onfocus=&quot;this.blur()&quot; value=&quot;some text&quot; />

 
it would be

document.forms[index].elements[index].style.color = 'red';

and no, it wont work if its disabled... atleast the text color wont change. but,

document.forms[index].elements[index].style.backgroundColor = 'red';
will work luciddream@subdimension.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top