Hello all.
I have the following scenario - a few dropdwon lists and a textbox.
I'd like to 'reset' these drop downs to their original value when a user clicks on the textbox:
Javascript:
function ResetDropDowns()
{
var ddlSuppliers = document.getElementById('<%=ddlSuppliers.ClientID%>');
var ddlResponse = document.getElementById('<%=ddlResponse.ClientID%>');
var ddlImportStatus = document.getElementById('<%=ddlImportStatus.ClientID%>');
ddlSuppliers.selectedIndex = -1;
ddlResponse.selectedIndex = -1;
ddlImportStatus.selectedIndex = -1;
}
Code behind:
tbxAutoCompleteSupplier.Attributes.Add("onFocus", "return ResetDropDowns();");
protected void ddlSuppliers_DataBound(object sender, EventArgs e)
{
ddlSuppliers.Items.Insert(0,
new ListItem("--Please Select Supplier--", "0"));
}
However, this does not seem to do the business.
Any ideas?