Hello,
the issue wasn't reproduced locally. Please, see attached sample
We didnt get it to work with the example you provided. I try to explain again:
With basis in you example, your xml contains:
<complete>
<option value="1">one</option>
<option value="2">two</option>
<option value="3">three</option>
<option value="4">four</option>
<option value="5">five</option>
<option value="6">six</option>
<option value="7">seven</option>
<option value="8">eight</option>
<option value="9">nine</option>
<option value="10">ten</option>
</complete>
What we want to do from web is tho add option "Eleven" or "Twelve" from the autocomplete box. So that users can dynamically add more options as time goes. Here is our code based on the example you provided us:
<html>
<head>
<title>FORM integration</title>
<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>
</head>
<body>
<h1>FORM integration</h1>
<p>Combo can be integrated with form.<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. Element is set as "true" when selected value isn't equal to any of the options, else its value is "false"</p>
<h3>From select box</h3>
<a href="#" onclick=hallo();>test submit</a>
<form id="boks">
<div id="combo_zone3" style="width:200px; height:30px;"></div></form>
<script>
var z=new dhtmlXCombo("combo_zone3","alfa5",200);
z.enableFilteringMode(true,"data.xml",true,true);
function hallo() {
data = z.getSelectedText();
var dataB = dump(data);
alert(dataB);
}
function dump(arr,level) {
var dumped_text = "";
if(!level) level = 0;
//The padding given at the beginning of the line.
var level_padding = "";
for(var j=0;j<level+1;j++) level_padding += " ";
if(typeof(arr) == 'object') { //Array/Hashes/Objects
for(var item in arr) {
var value = arr[item];
if(typeof(value) == 'object') { //If it is an array,
dumped_text += level_padding + "'" + item + "' ...\n";
dumped_text += dump(value,level+1);
} else {
dumped_text += level_padding + "'" + item + "' => \"" + value + "\"\n";
}
}
} else { //Stings/Chars/Numbers etc.
dumped_text = "===>"+arr+"<===("+typeof(arr)+")";
}
return dumped_text;
}
</script>
</body>
</html>
Try to use getComboText instead of getSelectedText as the last one return text of existent options
function hallo() {
data = z.getComboText();
var dataB = dump(data);
alert(dataB);
}