0

How to programmatically set CSS style of the input element of a combobox?

asked 2010-07-02 05:11:05 +0800

fumrob gravatar image fumrob
21

updated 2010-07-02 05:11:21 +0800

I want to change the style of the input element of a combobox programmatically.

Combobox.setSclass(...) doesn't work, because it does not set the style of the contained input box.

Is it possible to access the input box element somehow?

The reason is that I have a button event listener that should check the content of a combobox and change the backround color of the combobox if the content is not valid.

delete flag offensive retag edit

2 Replies

Sort by ยป oldest newest

answered 2010-07-02 06:04:54 +0800

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

Have you tried .setStyle(" ... "); ?

link publish delete flag offensive edit

answered 2010-07-07 04:57:13 +0800

SimonPai gravatar image SimonPai
1696 1

Hi fumrob,

Have you tried to use an SClass with CSS selector like:

<style>
.mySClass .z-combobox-inp {
	background: red;
}
</style>

This selector should match any element with class "z-combobox-inp" (which is the input field) with ancestor of class "mySClass". By adding and removing SClass "mySClass" you should be able to switch the background programmatically.

Regards,
Simon

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: 2010-07-02 05:11:05 +0800

Seen: 464 times

Last updated: Jul 07 '10

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