HighDots Forums  

Disabled

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Disabled in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
shapper
 
Posts: n/a

Default Disabled - 11-04-2008 , 02:10 PM






Hello,

I would like to change the look of disabled inputs of type text on my
web site.

Should I add a disabled css class to all these inputs or is it
possible to select them in my CSS Code ...
.... not using an ID or a class ...

Thanks,
Miguel

Reply With Quote
  #2  
Old   
Ben C
 
Posts: n/a

Default Re: Disabled - 11-04-2008 , 02:51 PM






On 2008-11-04, shapper <mdmoura (AT) gmail (DOT) com> wrote:
Quote:
Hello,

I would like to change the look of disabled inputs of type text on my
web site.

Should I add a disabled css class to all these inputs or is it
possible to select them in my CSS Code ...
... not using an ID or a class ...
There's a :disabled pseudo-selector, but it's CSS 3. You could try and
it see if it works.


Reply With Quote
  #3  
Old   
shapper
 
Posts: n/a

Default Re: Disabled - 11-04-2008 , 02:59 PM



On Nov 4, 7:51*pm, Ben C <spams... (AT) spam (DOT) eggs> wrote:
Quote:
On 2008-11-04, shapper <mdmo... (AT) gmail (DOT) com> wrote:

Hello,

I would like to change the look of disabled inputs of type text on my
web site.

Should I add a disabled css class to all these inputs or is it
possible to select them in my CSS Code ...
... not using an ID or a class ...

There's a :disabled pseudo-selector, but it's CSS 3. You could try and
it see if it works.
I need to work in IE6, FF2, Opera 8, ...

I think in this case, probably adding a Disabled class might be the
better solution.

Thanks,
Miguel


Reply With Quote
  #4  
Old   
Johannes Koch
 
Posts: n/a

Default Re: Disabled - 11-04-2008 , 03:01 PM



shapper schrieb:

Quote:
I would like to change the look of disabled inputs of type text on my
web site.
You want to select input elements with type attribute value "text" and
disabled _attribute_ value "disabled"? So you could use the _________
selector.

--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)


Reply With Quote
  #5  
Old   
Jukka K. Korpela
 
Posts: n/a

Default Re: Disabled - 11-04-2008 , 03:37 PM



Ben C wrote:

Quote:
There's a :disabled pseudo-selector, but it's CSS 3.
That is, it is part of a sketchy draft for a proposal, formally in
"progress", practically more or less stuck, though partly implemented,
sloppily and in incompatible ways.

Quote:
You could try and it see if it works.
Or you could check http://www.quirksmode.org/css/contents.html and quickly
see that there is no support in any version of IE, including IE 8 beta.

Johannes Koch alluded to use of input[disabled] which is part of "CSS 2" and
is supported by advanced browsers as well as (in "standards" mode) in IE 7.

It's still poor coverage of course. For good browser support, you would need
to use class attributes, either on the input elements or, if they appear in
groups, on containers (like div or fieldset) so that you can use a suitable
contextual selector like
..disabled input { ... }
(for, say, <div class="disabled">...</div> where all <input> elements inside
it are disabled).

But what's the point of using an input field that cannot be used for input?
There's usually a better approach, with better styling possibilities
together with other benefits. (It's impossible to suggest a specific
approach without knowing the specific original problem that disabled fields
were supposed to solve.)

--
Yucca, http://www.cs.tut.fi/~jkorpela/



Reply With Quote
  #6  
Old   
Christian Kirsch
 
Posts: n/a

Default Re: Disabled - 11-05-2008 , 04:36 AM



Jukka K. Korpela schrieb:

Quote:
But what's the point of using an input field that cannot be used for input?
Think of a "Save" button that is disabled as long as the text field for
the filename is empty. Or of an input field that is only meaningful if
e.g. a checkbox is selected. Yes, there are other ways, but this is
standard GUI stuff, I think


Reply With Quote
  #7  
Old   
shapper
 
Posts: n/a

Default Re: Disabled - 11-05-2008 , 09:05 AM



On Nov 5, 9:36*am, Christian Kirsch <c... (AT) bru6 (DOT) de> wrote:
Quote:
Jukka K. Korpela schrieb:

But what's the point of using an input field that cannot be used for input?

Think of a "Save" button that is disabled as long as the text field for
the filename is empty. Or of an input field that is only meaningful if
e.g. a checkbox is selected. Yes, there are other ways, but this is
standard GUI stuff, I think
The case here is that I have 3 forms: Create, Edit and Delete.
In Create form all items can be changed.
In Edit form a few items cannot be changed like username, ...
In Delete form all items are blocked. The inputs only show info on the
user before the user is deleted if that's the intention.

Thanks,
Miguel


Reply With Quote
  #8  
Old   
Christian Kirsch
 
Posts: n/a

Default Re: Disabled - 11-05-2008 , 09:44 AM



shapper schrieb:
Quote:
On Nov 5, 9:36 am, Christian Kirsch <c... (AT) bru6 (DOT) de> wrote:
Jukka K. Korpela schrieb:

But what's the point of using an input field that cannot be used for input?
Think of a "Save" button that is disabled as long as the text field for
the filename is empty. Or of an input field that is only meaningful if
e.g. a checkbox is selected. Yes, there are other ways, but this is
standard GUI stuff, I think

The case here is that I have 3 forms: Create, Edit and Delete.
In Create form all items can be changed.
In Edit form a few items cannot be changed like username, ...
In Delete form all items are blocked. The inputs only show info on the
user before the user is deleted if that's the intention.

Then Jukka is indeed right: What's the point of having input elements in
a form that are never enabled? Disabled elements should give the user an
indication that thy *might* be possibly enabled under certain
circumstances. This is apparently not the case in your delete and edit
forms. Why not simply display the text as text then?


Reply With Quote
  #9  
Old   
Michael Stemper
 
Posts: n/a

Default Re: Disabled - 11-05-2008 , 01:37 PM



In article <1p2Qk.88541$_03.80866 (AT) reader1 (DOT) news.saunalahti.fi>, Jukka K. Korpela writes:

Quote:
But what's the point of using an input field that cannot be used for input?
It's a method for having information on a page change, possibly as
a result of a calculation. If you create a local application (the
classic example that comes to mind is everybody's favorite, a
mortgage amortization program), you need some way to show the outputs
after the user has provided the inputs.

--
Michael F. Stemper
#include <Standard_Disclaimer>
"Writing about jazz is like dancing about architecture" - Thelonious Monk



Reply With Quote
  #10  
Old   
Johannes Koch
 
Posts: n/a

Default Re: Disabled - 11-05-2008 , 04:40 PM



Michael Stemper schrieb:
Quote:
In article <1p2Qk.88541$_03.80866 (AT) reader1 (DOT) news.saunalahti.fi>, Jukka K. Korpela writes:

But what's the point of using an input field that cannot be used for input?

It's a method for having information on a page change, possibly as
a result of a calculation. If you create a local application (the
classic example that comes to mind is everybody's favorite, a
mortgage amortization program), you need some way to show the outputs
after the user has provided the inputs.
Of course, there are other methods of showing data and other content
without using disabled input elements.

--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.