Hi!
I have a question concerning the combo-box. I’m filling the box with values I generate throw a mysql query and assign the return values to the box. Further I initialize the combo box with a default text. This one i set wit setComboText. And exactly this text should be displayed in another font color to display the user, wheter he has choosen a value from the box or the box is set to default.
How would this be possible?
Stefan
If you set default option, you can set especial style for the combo input element:
z.setComboText(…);
z.DOMelem_input.style.color= ‘blue’;
And when used change option from the list, you should set another color:
z.attachEvent(“onChange”,function(){
z.DOMelem_input.style.color= ‘black’;
})
Thanks for you reply, but it that didn’t worked for me.
I defined a div like that:
<div id="input_organismus"style=“width:120px; height:30px;”>
Here is the initialisation-code for the combo box:
So everything is fine and it works, but when i try to set a color for the standard value, even during initialisation with css like
organismus.addOption(0,“oganismus”,“color: red;”);
it doesn’t work.
And when I try to access the element of the ComboBox via DOM (the way you showed me):
organismus.organismus.style.color=‘red’;
I get a JS “no properties” error.
I think I have a stupid error in it, but I couldn’t find it. Maybe you can help me again.
Greetings Stefan Lexow