I'm having an issue when I clear the selected value of a ComboBox via client side javascript. The box appears to remove the selected text, but on postback the original text is still selected (and displays in the ComboBox's textbox). In other words, clicking the reset button does not clear my selection from the ComboBox.
Here's the javascript:
Here's the javascript:
<script language="javascript" type="text/javascript">
function clearAllControls() {
var vendor = $find("<%= ddVendor.ClientID %>");
if (vendor!=null) {
vendor.trackChanges();
vendor.set_text(
"");
vendor._applyEmptyMessage();
vendor.commitChanges();
}
return false;
}
</script>
I've also tried:
<script language="javascript" type="text/javascript">
function clearAllControls() {
var vendor = $find("<%= ddVendor.ClientID %>");
if (vendor!=null) {
vendor.clearSelection();
vendor.commitChanges();
}
return false;
}
</script>
Here's the aspx:
<asp:Button ID="btnReset" runat="server" ResourceId="NewOrderSearch_ResetButton" Text="Reset" OnClientClick="clearAllControls(); return true;" CausesValidation="false" />