DHTMLX Docs & Samples Explorer

Operations with combobox

1. Show/Hide combo as

       combo.show(mode);

2. Enable/Disable readonly mode as

       combo.readonly(mode);

3. Enable/Disable disabled mode as

       combo.disable(mode);

Accessing combo elements

You can access the input element of the combo as combo.DOMelem_input . Direct access to the element allows to assign custom event handlers. The next code for example limits input in combo, allowing only digits

		dhtmlxEvent(combo.DOMelem_input, "keypress", function(e){
			e = e||event;
			var code = e.which||e.keyCode;
			if (code >=48 && code < 58) return true;
 
			e.cancelBubble=true;
			if (e.preventDefault) e.preventDefault();
			return false;
		});