Black text in Disabled text input?

J

jodleren

Hi!

I have a <input type="text" name="indeks" size=2 disabled>
It is used for some JS which places its output here.

How can I keep the text black, and eventually have the background in
the same colour as the page background colour?

WBR
Sonnich
 
D

David Dorward

I have a <input type="text" name="indeks" size=2 disabled>
It is used for some JS which places its output here.
How can I keep the text black, and eventually have the background in
the same colour as the page background colour?

You don't. Its an input, the purpose of the control is to collect data
from the user. If you want to display output, use something else, such
as a paragraph.
 
J

Jonathan N. Little

David said:
You don't. Its an input, the purpose of the control is to collect data
from the user. If you want to display output, use something else, such
as a paragraph.

Or use <input type="hidden" name="indeks" value="To be set with JS">
 
B

BootNic

Hi!

I have a <input type="text" name="indeks" size=2 disabled>
It is used for some JS which places its output here.

How can I keep the text black, and eventually have the background in
the same colour as the page background colour?

If you really need to display this in a input, perhaps rather then using
the disabled attribute, try the readonly attribute.

Although I think Jonathan's suggestion for a form element that you don't
want a user to edit is the best one.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,185
Latest member
GluceaReviews

Latest Threads

Top