473,397 Members | 2,099 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Disabled

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
Nov 4 '08 #1
16 2950
On 2008-11-04, shapper <md*****@gmail.comwrote:
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.
Nov 4 '08 #2
On Nov 4, 7:51*pm, Ben C <spams...@spam.eggswrote:
On 2008-11-04, shapper <mdmo...@gmail.comwrote:
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
Nov 4 '08 #3
shapper schrieb:
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.)
Nov 4 '08 #4
Ben C wrote:
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.
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">...</divwhere all <inputelements 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/

Nov 4 '08 #5
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
Nov 5 '08 #6
On Nov 5, 9:36*am, Christian Kirsch <c...@bru6.dewrote:
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
Nov 5 '08 #7
shapper schrieb:
On Nov 5, 9:36 am, Christian Kirsch <c...@bru6.dewrote:
>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?
Nov 5 '08 #8
In article <1p*******************@reader1.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.

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

Nov 5 '08 #9
Michael Stemper schrieb:
In article <1p*******************@reader1.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.)
Nov 5 '08 #10
Ben C wrote:
On 2008-11-04, shapper <md*****@gmail.comwrote:
>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.
How does one declare the version of CSS one is using? I've searched all
over the the answer, and finally gave up.

Catherine
Nov 17 '08 #11
In article <gf**********@news.motzarella.org>,
pecan <pe***@NOSPAMrouxville.infowrote:
How does one declare the version of CSS one is using? I've searched all
over the the answer, and finally gave up.
If you did, it would probably fall on deaf ears.

--
dorayme
Nov 17 '08 #12
On 2008-11-17, pecan <pe***@NOSPAMrouxville.infowrote:
Ben C wrote:
>On 2008-11-04, shapper <md*****@gmail.comwrote:
>>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.

How does one declare the version of CSS one is using? I've searched all
over the the answer, and finally gave up.
I don't think you can. You just use what you use and hope the browsers
support it.

These days 2.1 is the one all the browsers are aiming for (not 2,
although if you read the blurbs at the top you would think 2 was meant
to be more pukka). Certain things from CSS 3 (opacity for example) are
also widely supported.
Nov 17 '08 #13

pecan wrote:
>
How does one declare the version of CSS one is using?
For validation purposes, the W3C validator gives you a choice under "more options".

For browsers, you don't. Browsers render per their own capabilities, which you cannot control. If there are conflicting specs between different CSS versions, all you can do is test in the most used browsers, and decide what works best overall.

For example, the width property was required for floats in CSS 2.0, but is optional in 2.1. The only browser I know of that follows 2.0 in this case is Mac IE5, but that's a dead browser so who cares?

--
Berg
Nov 17 '08 #14
pecan wrote:
Ben C wrote:
>On 2008-11-04, shapper <md*****@gmail.comwrote:
>>Hello,

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

As I said else where in the thread, why would you want to change the
look of disabled input? From a usability standpoint to deviate from what
the user knows and recognizes as a *disabled* control would not be
helpful. Bad idea. Why confuse your users? It is like designer who
insist on using underline instead of bold to emphasize text whn
underlined text is a web convention than means a link!
>>>
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.
a 2.1 way is

input[disabled]

*no IE <=6 support.
>
How does one declare the version of CSS one is using? I've searched all
over the the answer, and finally gave up.
Because you cannot. Proper browser behavior is to ignore what it does
not support.

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Nov 17 '08 #15
Bergamot wrote:
>
pecan wrote:
>>
How does one declare the version of CSS one is using?

For validation purposes, the W3C validator gives you a choice under
"more options".

For browsers, you don't. Browsers render per their own capabilities,
which you cannot control. If there are conflicting specs between
different CSS versions, all you can do is test in the most used
browsers, and decide what works best overall.

For example, the width property was required for floats in CSS 2.0, but
is optional in 2.1. The only browser I know of that follows 2.0 in this
case is Mac IE5, but that's a dead browser so who cares?
Ahhh... it was when I was validating my css at some stage, that I was
trying to find out how to declare it. Next time I'll look for the "more
options".
Thanks.

C
Nov 17 '08 #16
In article <6o************@mid.individual.net>,
Bergamot <be******@visi.comwrote:
The only browser I know of that follows 2.0 in this case is Mac IE5, but
that's a dead browser so who cares?
Oy!

--
dorayme
Nov 17 '08 #17

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: David Wake | last post by:
I have two radio buttons and two checkboxes in a form. I'm trying to write some code so that when a radio button is selected, its corresponding checkbox is disabled. My code looks like this: ...
5
by: bart plessers | last post by:
Hello, Somewhere in my code I have <input TYPE="button" NAME="btnFirst" VALUE="<<" OnClick="GetFile('1')" DISABLED> I changed the layout of the INPUT with a stylesheet to INPUT { color:...
3
by: Kelly Domalik | last post by:
I would like to override the "disabled" property of a hidden field. When disabled is set to "true", it would call a function to disable 2 other text fields on the form. When disabled is set to...
1
by: Martin | last post by:
Is disabled to be set in the style of a tag just like visible? I am trying to set the whole content of a td tag to disabled like this, style='disabled:true' and it does not seem to work. Is this...
4
by: | last post by:
Please, help. I created my contol, ButtonX, which subclasses System.Forms.Windows.Button class. I am doing my own paiting, by overriding OnPaint and OnPaintBackground (without calling base...
3
by: Rachel Suddeth | last post by:
I didn't know what to put for a subject, so I just tell you a problem requirement they want for my ap. If the user hovers over a disabled control, they want a text bubble to explain why it's...
6
by: Stu Carter | last post by:
Hi, I have an aspx page where some controls are initially disabled by the code-behind 'Page_Load' event. I want these controls to be dynamically enabled when the user checks a checkbox. ...
6
by: tshad | last post by:
I am trying to disable and enable a checkbox from javascript. The problem is that if the checkbox starts out as: <input id="Override" type="checkbox" name="Override"/> I can change it back...
2
by: CreativeMind | last post by:
hi i have following code but problem is that when i debug both checkboxes have disabled property always false whether it is checked or unchecked..thx for help. function checkFinance(){ var...
5
by: Steve Swift | last post by:
Is there an event which is triggered when JavaScript is about to be disabled? -- Steve Swift http://www.swiftys.org.uk/swifty.html http://www.ringers.org.uk
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.