Font color of (disabled) textbox

liunx

Guest
How do I change the font color of a (disabled) textbox?

I made an input box, and another input box which I disabled.

The idea is to fill in a value in box1, press a button, and get a value after a calculation.
Only the value in the disabled box should be red instead of grey...


<form>
<input type="text" name="box1"> <input type="button" name="button1">pyroclasm
03-08-2005, 04:27 PM

It will work if you put:


<html>
...

<style>
#box2 {
...
}
</style>

...
<input type="text" name="box2" id="box2" disabled>
...And what do I have to put between the <style> tags to change the color?
I'm quite new to CSS, so I need a little more...

In advanced thanks,

Regards,

Ren?/div>
ffurnai
03-08-2005, 04:44 PM

<style>
#box2 {
color: #000000;
}
</style>You can change the disabled field's color in FF but not in IE
An alternative is this:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>disabled field</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
<!--
#box2 {
background:lightgrey;
color:red
}
-->
</style>

</head>
<body>
<form>
<input type="text" name="box1"> <input type="button" name="button1">shivanayak
12-05-2006, 07:28 AM

Is it same with IE6 and IE7, that disabled textbox font cant be changed? I have requirement to make it a generic CSS element to make it to work, new to CSS.

thank you in advance.
 
Back
Top