Browser AutoComplete Not working in IE 8
-
I am using a .ascx page in a aspx page. The ascx page contains a textbox and a search button. The Enter key was not working with search but when we put following line textboxsearchInput.Attributes.Add("onkeydown", "if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {document.getElementById('" + btnSearch.ClientID + "').click();return false;}} else {return true}; "); on the page load method of the ascx page the Enter key starts working but now the auto complete functionality of the text box is not working, When we go to any option in the auto complete drop down and press Enter the form is submitted without considering that option. Please help if any one have some idea.
-
I am using a .ascx page in a aspx page. The ascx page contains a textbox and a search button. The Enter key was not working with search but when we put following line textboxsearchInput.Attributes.Add("onkeydown", "if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {document.getElementById('" + btnSearch.ClientID + "').click();return false;}} else {return true}; "); on the page load method of the ascx page the Enter key starts working but now the auto complete functionality of the text box is not working, When we go to any option in the auto complete drop down and press Enter the form is submitted without considering that option. Please help if any one have some idea.
You can set Default Button instead of assign Click Event of textbox just add the following code:
<asp:Panel runat="server" ID="pnlSearch" DefaultButton="btnSearch">
<asp:TextBox runat="server" ID="txtSearch"></asp:TextBox>
<asp:Button runat="server" ID="btnSearch" />
</asp:Panel>Thanks, Imdadhusen
sunaSaRa Imdadhusen +91 99095 44184