Combo in form and enableFilteringMode

Hello,
I attach two images to show you my problem with form and combo in IExplorer 8 and 9.
In the image stand_alone_combo.png I create a combo and I enable its filtering mode. All works fine when I type something (“4” in the image) in the combo.
In the image in_form_combo.png I insert the combo in a form. As you look, when I type “4” in the combo, the cursor goes at the end of the automatically inserted text, and if I continue pressing “1” to receive all the beginning with “41” options, the “1” is added at the end of the existing text in the combo.
In the last case there’s no way to select the whole text in the combo or any part of it, manually too.
I have this problem only with IExplorer 8 and 9. With Firefox both examples works fine.
How can I solve this problem? (Using Firefox instead IExplorer is not a valid answer…)

Thanks!!

Simone



What version of dhtmlxForm are you using? Can you provide complete demo where we can reproduce it?

Hello,
I use dhtmlx3.
If you try the code below in IE you can see that the two combo on the right (c and c3 in the code) works fine; the first one (c2 in the code) does not work.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<style type="text/css">
html,body {
	width: 100%;
	height: 100%;
	padding: 0;
	margin: 0;
}
</style>
<link rel="STYLESHEET" type="text/css" href="dhtmlx.css"></link>
<script type="text/javascript" src="dhtmlxcommon.js"></script>
<script type="text/javascript" src="dhtmlxcombo.js"></script>
<script type="text/javascript" src="dhtmlxform.js"></script>
<script type="text/javascript" src="dhtmlxform_item_combo.js"></script>
<script type="text/javascript">
var struct = "<?xml version='1.0' encoding='UTF-8'?><items><item type='combo' name='myCombo2' inputWidth='200'><option value='1' text='aaaa'/><option value='2' text='abbbb'/><option value='3' text='bbbb'/></item></items>"

window.onload = function() {
	var f = new dhtmlXForm("form_container"); 
	f.loadStructString(struct);
	var c2 = f.getCombo('myCombo2');
	c2.enableFilteringMode(true);
	
	var c = new dhtmlXCombo("combo_container","alfa2",200);
	c.loadXMLString("<complete><option value='1' text='aaaa'/><option value='2' text='abbbb'/><option value='3' text='bbbb'/></complete>");
	c.enableFilteringMode(true);
	
	var c3 = dhtmlXComboFromSelect("combo_select");
	c3.loadXMLString("<complete><option value='1' text='aaaa'/><option value='2' text='abbbb'/><option value='3' text='bbbb'/></complete>");
	c3.enableFilteringMode(true);
	


}

</script>
</head>
<body>
<div id='form_container'></div>
<div id='combo_container'></div>
<div>
<select style='width:200px;' id="combo_select"></select>
</div>
</body>
</html>

I attach the file too.
Regards

Simone
index.zip (814 Bytes)

up!

Hi

Edit your dhtmlxform_item_combo.js

[code]dhtmlXForm.prototype.items.combo = {
render: function(item, data) {


this.doAddLabel(item, data);
this.doAddInput(item, data, “SELECT”, null, true, true, “dhxlist_txt_select”);
this.doAttachEvents(item);
this.doLoadOpts(item, data);

	// after this block of code add:
	item.onselectstart = function(e){e=e||event;e.returnValue=true;return true;}
}

}[/code]