0

Change disabled textbox text color.

asked 2009-10-10 12:21:34 +0800

baskaraninfo gravatar image baskaraninfo
526 2 2 9

How to change the disabled text color of textbox field?

My code:

<window border="normal">
	<style>
		.z-textbox-disd { color: red; }
	</style>
	<textbox disabled="true" text="dafdsa" />
</window>

The above code doesn't works.

Thanks.

delete flag offensive retag edit

11 Replies

Sort by ยป oldest newest

answered 2009-10-10 12:27:30 +0800

baskaraninfo gravatar image baskaraninfo
526 2 2 9

This works:

<style>
	.z-textbox { color: red; }
</style>
<textbox readonly="true" text="dafdsa" />

But, this doesn't:

<style>
	.z-textbox { color: red; }
</style>
<textbox disabled="true" text="dafdsa" />

Any way of setting text color for disabled field?

Thanks.

link publish delete flag offensive edit

answered 2010-06-24 02:38:24 +0800

baskaraninfo gravatar image baskaraninfo
526 2 2 9

The following code works in firefox-3.6.4 but not in IE-7:

<textbox disabled="true" text="dafdsa" style="color: #FF0000 !important;" />

My Work Environment:
zk-bin-5.0.1
Eclipse Java EE IDE for Web Developers.
ZK Studio Version: 0.9.6

Any work around available for this?

Thanks.

link publish delete flag offensive edit

answered 2010-06-24 03:15:02 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

I need the same for a disabled Datebox. The default color is gray on white background ??????? I need a good readable black on white.
Please have a look on this comp too.

Thanks
Stephan

link publish delete flag offensive edit

answered 2010-06-24 03:23:29 +0800

tomyeh gravatar image tomyeh
610 1 3
http://blog.zkoss.org ZK Team

updated 2010-06-24 03:26:22 +0800

You have to specify !important (Please take a look at CSS source code). For example,

<zk>
<style>
.z-textbox { color: red; }
.z-textbox-disd, .z-textbox-disd * { color: green !important;}
</style>
<textbox text="dafdsa" />
<textbox disabled="true" text="dafdsa" />
</zk>

However, we cannot really change the font color of disabled textbox (INPUT) in IE.

For example, you can create a plain HTML page as follows and try with IE:

<html>
<body>
<input style="color:red" disabled value="foo"></input>
</body>
</html>

link publish delete flag offensive edit

answered 2010-06-24 03:50:27 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

Thanks Tom,

!important works for me.

best
Stephan

link publish delete flag offensive edit

answered 2010-06-24 04:51:03 +0800

baskaraninfo gravatar image baskaraninfo
526 2 2 9

Thanks Tom :)

You are correct, the html sample page proved IE has problem.

Thank you for your clarification.

link publish delete flag offensive edit

answered 2010-07-29 19:03:40 +0800

miguelmtz gravatar image miguelmtz
6
www.biaani.com

Sorry,
Why some change on 'z-textbox-text-disd' doesn't work in IE8,
I need to change this style, because I made some classes that extended Textbox in my app, and I can't use parts of code of html in all zul pages.
Are there some solutions for this point?
Thanks, and sorry for my bad English.

link publish delete flag offensive edit

answered 2010-08-04 05:24:07 +0800

jumperchen gravatar image jumperchen
3909 2 8
http://jumperchen.blogspo... ZK Team

Have you specified the keyword !important?

link publish delete flag offensive edit

answered 2010-08-04 16:21:17 +0800

miguelmtz gravatar image miguelmtz
6
www.biaani.com

I resolved my problem. I modified the value of opacity attribute,

filter: alpha(opacity=60);
to
filter: alpha(opacity=100);

because, the text is hard for read.

thx all.

link publish delete flag offensive edit

answered 2012-08-16 10:01:04 +0800

abb222222 gravatar image abb222222
30

I added in global css.

.z-textbox-disd, .z-decimalbox-disd, .z-intbox-disd, .z-longbox-disd, .z-doublebox-disd {
opacity: 1;
color: black !important;
background-color: #FFFFFF;
}

This works nice in firefox but doesn't work in IE8.0. Is there anyone who has workaround to make it more readable?

Please try
<HTML>
<HEAD>
<style type="text/css">
.disabled {
background-color: #FFFFFF;
}
</style>
</HEAD>
<BODY>
<input type="text" disabled class="disabled" value="Disabled">
</BODY>
</HTML>

This is acceptable, but seems that IE can't display the zk textbox with opacity = 1.

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2009-10-10 12:21:34 +0800

Seen: 6,541 times

Last updated: Aug 16 '12

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More