Integration with html form

Integration with HTML form


Server response



Combo can be integrated with form

The additional element in the submit array - NAME_new_value - gives information about a value: either it has been selected or user added new text
Element is set as "true" when selected value isn't equal to any of the options, else its value is "false"
</> Source
<!DOCTYPE html>
<html>
<head>
	<title>Integration with html form</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>
	<script>
		var myCombo;
		function doOnLoad() {
			myCombo = dhtmlXComboFromSelect("mySelect");
			myCombo.allowFreeText();
		}
		
		// we recommend to use confirmValue on form submit
		function confirmComboValue() {
			myCombo.confirmValue();
		}
	</script>
</head>
<body onload="doOnLoad();">
	<h3>Integration with HTML form</h3>
	<form target="bframe" action="../common/dump_post.php" method="POST" onsubmit="confirmComboValue();">
		<select id="mySelect" style="width:230px;" name="combo_1">
			<option value="the_adventures_of_tom_sawyer">The Adventures of Tom Sawyer</option>
			<option value="the_dead_zone">The Dead Zone</option>
			<option value="the_first_men_in_the_moon">The First Men in the Moon</option>
			<option value="the_girl_who_loved_tom_gordon">The Girl Who Loved Tom Gordon</option>
			<option value="the_green_mile">The Green Mile</option>
			<option value="the_invisible_man" selected="1">The Invisible Man</option>
			<option value="the_island_of_doctor_moreau">The Island of Doctor Moreau</option>
			<option value="the_prince_and_the_pauper">The Prince and the Pauper</option>
			<option value="the_running_man">The Running Man</option>
			<option value="the_talisman">The Talisman</option>
			<option value="the_time_machine">The Time Machine</option>
			<option value="the_tommyknockers">The Tommyknockers</option>
			<option value="the_war_of_the_worlds">The War of the Worlds</option>
		</select>
		<br>
		<input type="submit" value="Submit Form">
	</form>
	<h3>Server response</h3>
	<iframe name="bframe" id="bframe" style="width:500px; height:120px; border: 1px solid #c0c0c0;" frameBorder="0"></iframe>
	<br><br>
	Combo can be integrated with form<br><br>
	The additional element in the submit array - NAME_new_value - gives information about a value: either it has been selected or user added new text<br>
	Element is set as "true" when selected value isn't equal to any of the options, else its value is "false"
</body>
</html>

Documentation

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