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

Change Background Color of textbox?

Status
Not open for further replies.

bitwise

Programmer
Mar 15, 2001
269
US
Is it possible to change the background color of a simple input textbox? I just want to make the background gray so that the textbox looks disabled. I've tried all the obvious things. Thanks.

-bitwise
 
To change the background colour of a textbox:
Code:
<input type=&quot;text&quot; style=&quot;background-color:#999999;&quot;>

Is there some reason as to why you would want a textbox to 'look' disabled rather than 'be' disabled? That might be confusing for your users.

Never be afraid to share your dreams with the world.
There's nothing the world loves more than the taste of really sweet dreams.
 
Well, obviously, I would use the 'readonly' attribute when the textbox was grayed. Anyway, thanks!

-bitwise
 
<input type=&quot;text&quot; disabled> ?

Never be afraid to share your dreams with the world.
There's nothing the world loves more than the taste of really sweet dreams.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top