Allow free text

Allow free text


allow   disallow

If free text allowed - combo will accept any text entered,
if not - only options from list, not allowed by the default

Enter text and jump focus out from combo
</> Source
<!DOCTYPE html>
<html>
<head>
	<title>Allow free text</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>
		 td.descr_td {
		 	 padding-right: 50px;
		 	 vertical-align: top;
		 }
	</style>
	<script>
		var myCombo;
		function doOnLoad() {
			myCombo = new dhtmlXCombo("combo_zone", "combo", null, "image");
			myCombo.setImagePath("../common/flags/");
			myCombo.load("../common/data_countries.json");
			myCombo.enableFilteringMode(true);
		}
		function allowFreeText(mode) {
			myCombo.allowFreeText(mode);
		}
	</script>

</head>
<body onload="doOnLoad();">
	<h3>Allow free text</h3>
	<div id="combo_zone" style="width:230px;"></div>
	<br>
	<a href="javascript:void(0);" onclick="allowFreeText(true);">allow</a>
	&nbsp;
	<a href="javascript:void(0);" onclick="allowFreeText(false);">disallow</a>
	<br><br>
	If free text allowed - combo will accept any text entered,<br>
	if not - only options from list, not allowed by the default<br><br>
	Enter text and jump focus out from combo
</body>
</html>

Documentation

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