Within code behind, it is real easy to reset the combobox to a selected value of nothing combobox.selectedIndex = -1, I have tried multiple things to recreate this within javascript but can not seem to accomplish the same thing.
Does anyone know how to do this within javascript?
Thank you
Matthew Contri
I am putting the solution from the support case here so that everyone can find it in a search.
You can clear the selection and value by using the setValue method of the WebCombo. It would look something like this:var combo = igcmbo_getComboById("<%=WebCombo1.ClientID %>");combo.setValue(null);
This doesn't work. It sets the displayed text value in the drop down to "null". (And I don't have an option for "null).
Try this:
var combo = igcmbo_getComboById("<%=WebCombo1.ClientID %>");if (combo.Editable) { combo.setValue("");}else { combo.setValue(null);}
Correction: This doesn't work if Editable property is set to true. It does not display the "null" text value if Editable property is set to false.