PDA

View Full Version : Disabled fields



knguyen99
Dec 6th, 2002, 09:03 PM
I used the disabled="true" to lock the input text that make the text inside that field show not clear and not exactly the same color text as it was.
Any ideal?

DoubleV
Dec 6th, 2002, 09:08 PM
i think that is the way a browser handles disabled fields - it makes the text in them a sort of aligh-grey color (if i am not mistaken).
you could try assigning a class to that text box and declaring the text color in a stylesheet.

whammy
Dec 6th, 2002, 11:34 PM
you could also use:

readonly="readonly"

chrismiceli
Dec 7th, 2002, 05:53 AM
the disadvantages to applying style sheets to disabled and enabled input types is they override the disabled greyed out features, so you can't tell which one is disabled, it really sux. :(

DoubleV
Dec 9th, 2002, 02:45 PM
Originally posted by chrismiceli
the disadvantages to applying style sheets to disabled and enabled input types is they override the disabled greyed out features, so you can't tell which one is disabled, it really sux. :(
you make a very good point.

beetle
Dec 9th, 2002, 02:58 PM
CSS2's attribute selectors can help with that. Too bad IE doesn't see 'em.

input [disabled="true"] {
/* style rules here */
}

knguyen99
Dec 10th, 2002, 04:00 PM
I tried readonly="readonly". It's NOT worked.

beetle
Dec 10th, 2002, 04:22 PM
I prefer

<input ... readonly="true" ... />