I am using Combo v.2.6 build 100722
I startup the combo like this:
[code]var combo = new dhtmlXCombo(“combo_zone_store”, “f_store”, 230);
combo.enableFilteringMode(true, “select_store.php”);
combo.loadXML(“create_store2.php”);
combo.attachEvent(“onChange”, getResult);
combo.attachEvent("onOpen",function(){
window.setTimeout(function(){
var text = combo.getComboText();
combo.setComboText("");
combo.filterSelf();
},1);
});[/code]
I have this in the getResult()
function getResult() {
//if ($('input[name=f_route]').val().length>0 && $('input[name=f_store]').val().length>0) {
if ($('#ff_store').val().length>0 && $('#ff_store').val()!='0') {
console.log('Set combo text: '+$('#ff_store').val());
var temp=$('#ff_store').val();
$('#ff_store').val(0);
combo.setComboText(temp);
combo.filterSelf();
return;//to stop runing the *rest of the code*
}
// rest of the code
}
What I am trying to do is to select a value saved in the session. I’ve put from the session into the ff_store, the value that is saved on server side.
When the page loads I want the default value to be shown in the combo. The problem I have is that the values are loaded by Ajax, so I don’t know how to set the default value to it.
Can you please help me?