Hello,
I have question about how to make first selection ? The problem is that user can left filed without complete filled, I mean user start write quart and combo suggest him a few quarts, user see them but did not choice one of them like:
User write: alab
Combo suggest: Alabama 1, Alabama 2
User left field with tab or click elsewhere on page. With this action user will be misguided that he think first choice will be selected, but actually not.
Here is my script first:
var myCombo;
var myQuart;
function doOnLoad() {
myCombo = new dhtmlXCombo("city", "city", 350);
myCombo.setTemplate({
input: "#word#",
columns: [
{header: "Town", width: 100},
{header: "PO CODE", width: 50},
{header: "Department", width: 100},
{header: "Department 2", width: 100},
]
});
myCombo.enableFilteringMode(true, "loadCity.php", true, true);
myQuart = new dhtmlXCombo("quart", "quart", 350);
myQuart.setTemplate({
input: "#word#",
columns: [
{header: "Type", width: 50},
{header: "QuartName", width: 300},
]
});
myQuart.enableFilteringMode(true);
myCombo.attachEvent("onChange", function(value){
myQuart.clearAll();
myQuart.setComboValue(null);
myQuart.setComboText("");
var citys = value.split(',');
var cityid = citys[0];
if (cityid == null) {
myQuart.disable();
} else {
myQuart.enable();
myQuart.enableFilteringMode(true, "loadQuart.php?mask2="+cityid, true, true)
}
});
}
</script>