disabled color

  • Thread starter Jochen Fuhrmann
  • Start date
B

brucie

how can i change the color of a disabled fom field?

color:blah;background-color:blah;

color may be system disabled text color. changing default disabled
colors not recommended. it is not expected behavior.
 
J

Jochen Fuhrmann

brucie said:
color:blah;background-color:blah;

doesn't work for disabled fields
color may be system disabled text color. changing default disabled
colors not recommended. it is not expected behavior.

so is there another way to avoid that the curser gets into to field when i press
the tab key?
 
J

Jukka K. Korpela

Jochen Fuhrmann said:
doesn't work for disabled fields

Then you didn't use it properly, or used a browser that does not
support the relevant parts of relevant specifications. Hard to tell
without any specifics.
so is there another way to avoid that the curser gets into to field
when i press the tab key?

Pardon? If _that_ was the real question, why didn't you ask it in the
first place? And how would the color change help?

Disabled fields by definition do not participate in tabbing order.
Ref.: http://www.w3.org/TR/html4/interact/forms.html#adef-disabled
So either the field isn't disabled, or you are using a browser that
does not support the disabled attribute. Hard to tell without any
specifics.
 
B

brucie

doesn't work for disabled fields

it works for IE6, moz1.4 and opera7+
so is there another way to avoid that the curser gets into to field when i press
the tab key?

what has the color of the field got to do with tabbing? in any case
default behavior is for tabbing to skip disabled fields. stop doing
whatever you're doing so the default behavior works.
 
J

Jochen Fuhrmann

Then you didn't use it properly, or used a browser that does not
support the relevant parts of relevant specifications. Hard to tell
without any specifics.

Pardon? If _that_ was the real question, why didn't you ask it in the
first place? And how would the color change help?

the problem is, i disabled the <input> stuff, and the color changed, but i
wanted it to be black, so if theres another was to avoid the cursor in the field
that
would help otherwise i would like to have it "disabled black"

jochen
 
J

Jochen Fuhrmann

brucie said:
what has the color of the field got to do with tabbing? in any case
default behavior is for tabbing to skip disabled fields. stop doing
whatever you're doing so the default behavior works.

maybe my description wasn't that exact, the problem is, that if i disable the
input field, the
text color changes from black to bright grey, i wanna have it black. disable
tabbing works ... jochen
 
B

brucie

In post <[email protected]>
Jochen Fuhrmann said...

ie 6.0 <input style="color:rgb(0,0,0)"> -> its still kindof bright grey
^^^ you missed 'disabled'

'color' works with mozilla. opera and IE retain their defaults.
'background-color' works for all three.

i did say in my first post color may be the system default color.
 
B

Beauregard T. Shagnasty

Jochen Fuhrmann pounced upon this pigeonhole and pronounced:
maybe my description wasn't that exact, the problem is, that if i disable the
input field, the
text color changes from black to bright grey, i wanna have it black. disable
tabbing works ... jochen

If you should manage to change the color to black, imagine the frustration
of your visitor who tries and tries to type something there.

Leave it show as disabled, or use something else to display whatever it is
you want to display.
 
J

Jukka K. Korpela

Jochen Fuhrmann said:
the problem is, i disabled the <input> stuff
Why?

and the color changed,

A useful indicator, isn't it?
but i wanted it to be black,

Why? To mislead the user?
so if theres another was to
avoid the cursor in the field

Is that what you want, or do you wish to disable the field?

Why don't you just tell what you really wish to accomplish, in terms of
functionality, and illustrate it with a URL?
 
J

Jochen Fuhrmann

Jukka K. Korpela said:
Is that what you want, or do you wish to disable the field?
Why don't you just tell what you really wish to accomplish, in terms of
functionality, and illustrate it with a URL?

i'll try to descibe it. i wanna display a form that consists of 3 fields, one is
day, than a dot, the next is month followed by a dot and finally the year,
i want it to look like one field, and i wanna reach the 3 fields by pressing the
tab key. when i tried to just put the dot between the input fields or put the
whole thing in a table, the dot wasn't on the same hight as the numbers i
typed into the input fields, so i thought it would be best to use a disabled
field,
which how i described kind of worked, but i still want it to be black.

jochen
 
J

Jochen Fuhrmann

Beauregard T. Shagnasty said:
If you should manage to change the color to black, imagine the frustration
of your visitor who tries and tries to type something there.

dont think so, cause it doesn't look like a type in form, and because of my
background color they doesn't see anything, thats the main problem with
the whole "disabled color"
Leave it show as disabled, or use something else to display whatever it is
you want to display.

thats an option, maybe i should try something else

jochen
 
R

rf

Jochen Fuhrmann said:
i'll try to descibe it. i wanna display a form that consists of 3 fields, one is
day, than a dot, the next is month followed by a dot and finally the year,

Now that would be very confusing. Over here we use slashes to seperate the
date. In the USA they put the month first, followed by the day.

Three fields, clearly labeled "day", "month", "year" would IMHO be better.
i want it to look like one field, and i wanna reach the 3 fields by pressing the
tab key. when i tried to just put the dot between the input fields or put the
whole thing in a table, the dot wasn't on the same hight as the numbers i
typed into the input fields, so i thought it would be best to use a disabled
field,
which how i described kind of worked, but i still want it to be black.

There is nothing to allow you to change the colour of a disabled field
specifically. Mozilla does use the suggested colour for the text in the
field. Opera (my version anyway) ignores all colour. IE6 uses the system
defined "disabled" colour.

Since the browsers are not going to play with you on this one there is
simply nothing you can do.

If you really want to have it looking like this then don't use an input
field for the dots. Use a <span> and style it to look the way you want it
to.

Cheers
Richard.
 
B

Beauregard T. Shagnasty

Jochen Fuhrmann pounced upon this pigeonhole and pronounced:
dont think so, cause it doesn't look like a type in form, and because of my
background color they doesn't see anything, thats the main problem with
the whole "disabled color"


thats an option, maybe i should try something else

Will something like this work?

<form action="foo"...>
<fieldset>
<legend>Enter Date:</legend>
<label for="day">Day: </label> <input type="text" id="day" size="2">
<label for="month">Month: </label> <input type="text" id="month" size="2">
<label for="year">Year: </label> <input type="text" id="year" size="4">
</fieldset>
</form>

Style to taste.
 
J

Jochen Fuhrmann

rf said:
If you really want to have it looking like this then don't use an input
field for the dots. Use a <span> and style it to look the way you want it
to.

yeah, thats maybe the best solution
 
J

Jochen Fuhrmann

Beauregard T. Shagnasty said:
Will something like this work?
<form action="foo"...>
<fieldset>
<legend>Enter Date:</legend>
<label for="day">Day: </label> <input type="text" id="day" size="2">
<label for="month">Month: </label> <input type="text" id="month" size="2">
<label for="year">Year: </label> <input type="text" id="year" size="4">
</fieldset>
</form>

sure it'll work, but it doesnt help me with my problem, but i'll try it another
way,
and if it doesnt work, ill post an url to check ... thx jochen
 
B

brucie

Three fields, clearly labeled "day", "month", "year" would IMHO be better.

i like (dd/mm/yyyy) with a single input. easy to validate then use
list($day,$month,$year)=explode('/',$date); to suck out the d/m/y
 
J

Jukka K. Korpela

Jochen Fuhrmann said:
sure it'll work, but it doesnt help me with my problem,

Then we still don't know what your ultimate problem is. It surely
wasn't disabled color.

The proposed solution, or something rather similar to it, is surely the
best approach to the problem of date input. If you add markup that
makes each pair of label and input field appear on a line of its own
(using <div> container or <br> separator), it becomes comfortable to
the user, accessible (even a blind person, literally, finds it
suitable), and safe against common errors. (Beware of approaches that
take a date as a single string unless you can be sure that you agree
with the worldwide audience of what, say, 04/07/03 means - there are at
least six different interpretations.)

So if it does not help with your problem, what _is_ the problem?

But please do not bother answering before you can have those Shift and
"." keys fixed.
 
Joined
Feb 1, 2010
Messages
1
Reaction score
0
Input box properties

I was bashing my head on this one last week and found that if you don't want people to change the contents of an input box, you don't need to disable it.

Just declare it as Readonly..

E.G.
<input name="inputSomething" type="text" value="this is a test" readonly="readonly" id="inputSomething" />

8)

Hope that helps

Rob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top