I want to disable my select box when I click the submit button,but it failed! please help me!
this my code:
select box (we used jsf ):
we add a filter to the select box by the Combo when the page onload:
onload = function() {
Combo.convertSelect(‘frmCreateNPI:turbineType’,false);
}
the js file :
…
…
Combo = {
_instances: {},
/**
* convert the select box into a dhtml combo
* @param id the id for the select box
* @param filter boolean if enable filtering mode
* @param active if only apply for the enabled select list
* @return
*/
disableSelect: function(id,disabled){
var menu = document.getElementById(id);
var comp = null;
if (menu && menu.tagName == ‘SELECT’ && dhtmlXComboFromSelect) {
comp = dhtmlXComboFromSelect(id);
comp.enableFilteringMode(filter);
comp.disable(disabled);
}
},
convertSelect: function(id, filter) {
if (typeof filter == ‘undefined’) {
filter = true;
}
if (typeof window.dhx_globalImgPath == ‘undefined’) {
//set up for the xhtml dom images path
window.dhx_globalImgPath="…/images/";
}
var menu = document.getElementById(id);
var comp = null;
if (menu && menu.tagName == 'SELECT' && dhtmlXComboFromSelect) {
comp = dhtmlXComboFromSelect(id);
comp.enableFilteringMode(filter);
comp.disable(false);
}
if (comp != null) {
this._instances[comp.name] = comp;
}
return comp;
},
/**
* convert a list of select list into combo
*/
convertSelects: function() {
for (var i = 0; i < arguments.length; i++) {
this.convertSelect(arguments[i]);
}
},
getInstance: function(id) {
return this._instances[id];
},
getSelectedIndex: function(id) {
return this.getInstance(id).getSelectedIndex();
}
};
but when I click button call the javascript:Combo.disableSelect(‘frmCreateNPI:turbineType’,true)
it can’t disabled( after the add filter,the html code for select is not a select box ,change to the div),
How can I disable the select box after I add a filter?