views:

663

answers:

2

Hi there,

that one has been nagging me ever since I dabbled in web developpement; is there a way for this? Could I override that style and rely on some other mean to inform my users that that control can't be ineracted with?

My problem is that the graying of RadioButton- and CheckBox-Lists' labels makes them unreadable.

I could always replace the disabled TextBoxes with Labels styled/themed to look like TextBoxes, but that'd be more invasive...

[EDIT] Ok, sorry; that's not a solution; TextBoxes already have the "Readonly" option, which means they look the way I want them to, even when locked from user-input; the problem rather lies with IList Controls (RadioButtonLists and CheckBoxLists.)

As ever, thanks for your time!

+2  A: 

Sure! What it sounds like you're looking for is a CSS attribute selector:

input[@disabled=true], input[@disabled] {
  .. insert your new style here ..
}

Hope that helps!

Zachary Yates
A: 

Thank you for your quick reply, Zachary!

(Sorry mine took so long; I lost it when I followed your link, so I decided to make a few tests first...)

So far, I haven't been so succesfull; should it apply to server control as well, or only to plain html tags? Also, shouldn't I use [disabled=disabled], as I believe is the proper value for the disabled attribute? Can I use a class selector on it? Like input[disabled=disabled].myClassName so not all my disabled controls are affected?

Thank you again for your time; it's quite a few questions, but you might've noted CSS ain't my primary field! Pascal

Pinpin
Sorry, I didn't realize you replied in an answer. Everything you said is true, I did that example quite quickly. Your server controls are usually rendered as <input> tags as well, so the css should apply to them correctly.
Zachary Yates