Link to home
Start Free TrialLog in
Avatar of Andy Green
Andy GreenFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Override default disables style.

I have an online form, that once filled out and saved can be opened, for viewing. The problem is I'm using .Enabled=false on the radio buttons/ dropdowns and textboxes. This renders the content too light to be read.

I've had a google, and found some solutions but nothing works, ie I can over ride the disabled style.

for example this is ignored, even though I can see the style is being applied its not working:

      <style type="text/css">
            input {color: black; -webkit-text-fill-color: black;}
      </style>

Anyone have any ideas.

This is in chrome, but must work in Chrome & IE 10 up.

Andy
Avatar of Kelvin McDaniel
Kelvin McDaniel
Flag of United States of America image

Unfortunately, you can't modify that particular behavior consistently. The alternative is basically to show the value as text and either hide or remove the element altogether. If you still need to be able to submit the value then also add a hidden field that has the same name and value as your now removed/hidden radio button.
Avatar of Andy Green

ASKER

Thanks, what I'm trying to do now is remove the .enabled=false so the controls are again editable, but using a modal overlay, to stop users from accessing the controls.

I'm hoping I can set the transparency to make the values more visible.

Has anyone done this?

Andy
ASKER CERTIFIED SOLUTION
Avatar of Andy Green
Andy Green
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
To set the style for a disabled element, you usually use the disabled pseudo selector:

input:disabled { color: black; }