DHTMLX Docs & Samples Explorer

Initialization

From select box

From XML

From Javascript

Source
<script>
window.dhx_globalImgPath = "../../codebase/imgs/";
</script> <link rel="STYLESHEET" type="text/css" href="../../codebase/dhtmlxcombo.css"> <script src="../../codebase/dhtmlxcommon.js"></script> <script src="../../codebase/dhtmlxcombo.js"></script> <h3>From select box</h3> <select style='width:200px;' id="combo_zone1" name="alfa1"> <option value="1">a00</option> <option value="2">a01</option> <option value="3" selected>a02</option> <option value="4">a10</option> <option value="5">a11</option> <option value="6">a12</option> <option value="7">b00</option> <option value="8">b01</option> <option value="9">b02</option> <option value="10">b10</option> <option value="11">b11</option> <option value="12">b12</option> <option value="13">a22</option> <option value="14">a31</option> <option value="15">a04</option> </select> <h3>From XML</h3> <div id="combo_zone2" style="width:200px; height:30px;"></div> <h3>From Javascript</h3> <div id="combo_zone3" style="width:200px; height:30px;"></div> <script>
var z = dhtmlXComboFromSelect("combo_zone1");
var z = new dhtmlXCombo("combo_zone2", "alfa2", 200);
z.readonly(1);
z.loadXML("../common/data.xml");
 
var z = new dhtmlXCombo("combo_zone3", "alfa3", 200);
z.addOption([[1, 1111, "color:red"], [2, 2222], [3, 3333], [4, 4444], [5, 5555]]);
</script>