Click here to get back home

Forecolor of disabled controls

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Forecolor of disabled controls Man-wai Chang 02-15-2007
Get Chitika Premium
Posted by Man-wai Chang on February 15, 2007, 9:47 pm
Please log in for more thread options



How could I use the color black rather the default grey?

--
iTech Consulting Co., Ltd.
Specialized in providing ePOS solutions
Website: http://www.itech.com.hk (IE only)
Tel: (852) 2325 3883        Fax: (852)2325 8288

Posted by Ben C on February 16, 2007, 3:00 am
Please log in for more thread options


>
> How could I use the color black rather the default grey?

You can't control things like that (except possibly in CSS 3, which some
browsers support bits of).

An option is to write your own controls out of images etc. and
Javascript. Or better just get used to the default grey :)

Posted by Jukka K. Korpela on February 16, 2007, 6:28 am
Please log in for more thread options


Scripsit Ben C:

>>
>> How could I use the color black rather the default grey?
>
> You can't control things like that (except possibly in CSS 3, which
> some browsers support bits of).

That seems to be the case. Explicitly setting the color works for a normal
text input field but not for a disabled text input field. I first thought it
might relate to degree opacity, in which case CSS 3 might indeed have
something to offer, but setting the color, say, to red does not turn it to
pale red. Instead, the browser uses its own shade of grey, as if the style
sheet were not there.

> An option is to write your own controls out of images etc. and
> Javascript. Or better just get used to the default grey :)

Or best just get rid of disabled controls. What's the point anyway? Why
would you show the user something that looks somewhat like a form field but
does not get submitted along with a form (and cannot be modified).

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/


Posted by Jukka K. Korpela on February 16, 2007, 6:48 am
Please log in for more thread options


Scripsit Jukka K. Korpela:

>>> How could I use the color black rather the default grey?
>>
>> You can't control things like that (except possibly in CSS 3, which
>> some browsers support bits of).
>
> That seems to be the case. Explicitly setting the color works for a
> normal text input field but not for a disabled text input field.

Correction: That's true for IE up to and including IE 7, but Firefox seems
to have no restrictions in this respect. I don't know why you would use a
different color for a disabled field, but if you do, you might consider
using the CSS 3 property opacity as well, to give a visual message of the
disabled state. E.g.,

<input type="text" name="foo" value="bar" disabled
style="color: red; background: white; opacity: 0.5">

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/


Posted by Chris Morris on February 16, 2007, 7:14 am
Please log in for more thread options


> Or best just get rid of disabled controls. What's the point anyway?
> Why would you show the user something that looks somewhat like a form
> field but does not get submitted along with a form (and cannot be
> modified).

I agree that writing the disabling into the HTML is pointless, but not
that being able to disable a control necessarily is.

...
<input type='checkbox' name='q4' value='other'> Other (please state)
<input name='q4other' size='40'>
...

It might be a reasonable optional enhancement to this form to use
Javascript to initially set the 'other' <input> to be disabled (which
obviously can't be set as an initial state in the HTML), and then
enable and disable this as the relevant checkbox is used. Similarly
for complex data-collection requirements (e.g. checkbox F is only
available if two or more of checkboxes A, B and C are selected) where
it might help the user's mental model of the data. All optional and
backed up by the same logic server-side, naturally.

Whether this is more or less usable than modifying q4other's display
style between inline and none I'm not sure - I'd have to try both out.

--
Chris

Similar ThreadsPosted
Re: duplicate select controls February 23, 2007, 1:11 am
Re: duplicate select controls February 23, 2007, 10:21 am
Re: duplicate select controls June 13, 2007, 9:54 am
'sorry this function has been disabled' February 5, 2008, 10:09 am
with disabled attribute October 12, 2004, 11:47 am
grey-out/disabled item in listbox March 10, 2006, 11:22 pm
Swap images if Javascript is disabled June 27, 2006, 4:59 pm
DISABLED on HTML forms problem January 13, 2008, 12:39 pm
how can i change all disabled inputs background color ? February 28, 2006, 10:58 pm
Detecting if the client browser disabled/allows java applets ? November 1, 2004, 9:30 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap