Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by William Meuwissen on Jul 11, 2008 06:11
open dhtmlx forum
Give dhtmlXCombo own css values

I have a validate script in php that give a inputfield the css class ".error".
So when the user forget to fill in the field, the background-color of the field wil be red.

But how could I give my dhtmlXCombo box a own background color when the user select no data in the field.
Can I do this by using the next line: z.className = 'dhx_combo_box2' ?


<div id="shop" style="width:50px; height:30px; margin-top:7px; float: right;"></div>

<script>
var test=new dhtmlXCombo("shop","shop",50);
test.addOption([[37,"product1"],[36,"product2"],[1,"product3"]]);
z.className = 'dhx_combo_box2';
test.enableFilteringMode(true);
</script>
Answer posted by Support on Jul 11, 2008 07:05
You can acces DOM object of combo in next way

var test=new dhtmlXCombo("shop","shop",50);
test.addOption([[37,"product1"],[36,"product2"],[1,"product3"]]);
test.DOMelem_input.className += ' dhx_combo_box2';