Click here to Skip to main content
16,012,082 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,
I have asp control textbox with ajax auto complete extender...

when i select item in autocomplete extender with mouse click and i pressed enter button in keyboard....The submit button not fires....

What is the problem..Can anyone explain it.
Posted
Comments
bhagirathimfs 5-Jul-12 7:58am    
submit button is not fires
means???
vivekx2 5-Jul-12 8:08am    
For eg:selecting city in that autocomplete textbox and below that textbox,,, submit button is placed ...After selecting city and i press enter button the submit button not fires
bhagirathimfs 5-Jul-12 8:10am    
You want to fire the submit button when you press enter??
vivekx2 5-Jul-12 8:15am    
ya right...but after selecting any item in textbox...after selection the submit button not fires.

Use the Defaultbutton Of the form
Example:
ASP.NET
<form id="form1" runat="server" defaultbutton="Button1" defaultfocus="TextBox1"><

For more information refer this link
How To set Default Button for ENTER key pressed event, and How To set Focus on a particular Control when Page loads, and How To Shift Focus from One Control To Another when TAB key is pressed[^]
 
Share this answer
 
XML
You can set your button as DefaultButton putting textbox and button in a panel

<asp:Panel ID="Panel1" runat="server" DefaultButton="Button1">
<asp:TextBox runat="server" ID="txtcity" ></asp:TextBox>
            <div id="resultDiv" runat="server>
            </div>
            <cc1:AutoCompleteExtender ID="txtcity_AutoCompleteExtender" runat="server" MinimumPrefixLength="1"
                ShowOnlyCurrentWordInCompletionListItem="true" CompletionSetCount="10" ServiceMethod="getcityName"
                ServicePath="webservice.asmx" CompletionInterval="1000" CompletionListElementID="resultDiv"
                EnableCaching="true" TargetControlID="txtcity">
            </cc1:AutoCompleteExtender>
            <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />

</asp:Panel>

<pre lang="text">
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900