Grouping combos

Select state

California for example

Select city

</> Source
<!DOCTYPE html>
<html>
<head>
	<title>Grouping combos</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
	<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
	<link rel="stylesheet" type="text/css" href="../../../codebase/fonts/font_roboto/roboto.css"/>
	<link rel="stylesheet" type="text/css" href="../../../codebase/dhtmlx.css"/>
	<script src="../../../codebase/dhtmlx.js"></script>
	<style>
		div.combo_info {
			color: gray;
			font-size: 11px;
			padding-bottom: 5px;
			padding-left: 2px;
			font-family: Tahoma;
		}
	</style>
	<script>

		var myCombo, myCombo2;
		function doOnLoad() {
			myCombo = new dhtmlXCombo("combo_zone", "combo", 230);
			myCombo.load("../common/combo_group.php?mode=state");
			myCombo.enableFilteringMode(true);
			//
			myCombo2 = new dhtmlXCombo("combo_zone2", "combo2", 230);
			myCombo2.enableFilteringMode(true);
			myCombo2.disable();
			//
			myCombo.attachEvent("onChange", function(value){
				myCombo2.clearAll();
				myCombo2.setComboValue(null);
				myCombo2.setComboText("");
				if (value == null) {
					myCombo2.disable();
				} else {
					myCombo2.enable();
					myCombo2.load("../common/combo_group.php?state="+value);
				}
			});
		}
	</script>
</head>
<body onload="doOnLoad();">
	<h3>Select state</h3>
	<div class="combo_info">California for example</div>
	<div id="combo_zone" style="width:230px;"></div>
	<br>
	<h3>Select city</h3>
	<div id="combo_zone2" style="width:230px;"></div>
</body>
</html>

Documentation

Check documentation to learn how to use the components and easily implement them in your applications.