Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted on Jun 25, 2009 12:21
open dhtmlx forum
combo reset

This works fine to reset a combo but not when using checkboxes... the checkbox still does not disappear:
.setComboValue("");
.unSelectOption();

Answer posted by Alex (support) on Jun 25, 2009 23:21

You can try to use the following approach to hide checkbox:

combo.setComboValue("")
combo.DOMelem_checkbox.style.visibility = 'hidden';

Answer posted on Jul 02, 2009 09:09
Ok that works but we get this error:
this._selOption is null
http://team.phpmydirectory.com/dev/demo/includes/dhtmlx/combo/dhtmlxcombo.js
Line 56

We are using setComboValue("") on the onChange event.
Answer posted on Jul 02, 2009 09:30
Ok got it to work but when selecting options the checkbox still flashes up and then hides again everytime.


Answer posted by Alex (support) on Jul 06, 2009 02:29

If you want to clear combo input each time the value is selected you can try to use the following approach:

combo.attachEvent("onChange",clearInput)
combo.attachEvent("onSelectionChange",clearInput)

function clearInput(){
 window.setTimeout(function(){
  combo.setComboValue("");
  combo.DOMelem_checkbox.style.visibility = 'hidden';
 },1)
}