Styling a Combobox to change the background color based on input

0
Hello, I am looking for guidance on how to style a combobox widget such that: When no option has been selected (initial state), the combobox has a background color, e.g., aliceblue. Once the user selects an option or enters a value, the background color changes to white. I want to achieve this behavior using only CSS—no JavaScript or additional scripting.
asked
1 answers
1

Hi Jamie,

 

You can achieve this using dynamic classes. You can find this under the tab appearance of the combobox properties. Using an if statement like this:

 

if $currentObject/YourAttribute = empty then 'customcomboboxempty' else empty

 

And add this custom css to your styling

 

.customcomboboxempty .form-control {

background-color: aliceblue;

}

 

This way the combobox is aliceblue when not filled or focused.

answered