Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by William Meuwissen on Jul 11, 2008 10:14
open dhtmlx forum
Select option

Hello,

How can I select a option ID from the list?
So when I ask to show ID "36", he must show product2.

var product=new dhtmlXCombo("product","product",50);
product.addOption([[37,"product1"],[36,"product2"],[1,"product3"]]);
product.enableFilteringMode(true);

The same idea as:

<select name="product">
<option value="37">product3</option>
<option value="1">product3</option>
<option value="36" selected>product2</option>
</select>
Answer posted by Support on Jul 14, 2008 02:20
You can use setComboValue method

product.addOption([[37,"product1"],[36,"product2"],[1,"product3"]]);
product.setComboValue("36");