Label text turning grey when enabled = false

  • Thread starter Thread starter ReidarT
  • Start date Start date
R

ReidarT

I use a label to write some help-text in a web-form.
I don't want the user to be able to click in this field so I have disabled
it, enable = false.
The text color turns grey. I use a cssclass with another color and want it
to remain blue, not grey.
How do I avoid this?
regards
reidarT
 
I'm a little confused as to what you mean by click in the field. When the
Label is rendered as HTML, it ends up as a SPAN tag. So there is nothing to
actually click on as it were?

If you are referring to selecting the text, Im not sure what the problem is
? perhaps you could explain what you mean or what problem you are trying to
solve.
 
I have a textfield that comes with todays date. There is a button to the
left and a button to the right of the textfield that adds today with one,
and the other button subtracts the date with one. I don't want the user to
enter the textfield to change the date, I want them to do it only by
clicking the buttons.
(They only need to change the date from todays date and one or two days
ahead)
That is why I have disabled the field.
regards
reidarT
 
OK, you nead to change the Readonly Property to True. This has the effect of
stopping the user clicking in this field and chaning things at client side.
This is different to Enabled which is serverside control object property
rather than a Javascript object property on the client side.

Altering the readonly property for this control caused the Javascript
readonly attribute to be set when the page is rendered.

HTH
 
Back
Top