Jul 16, 2009, 12:06 AM
How to change enter pressing from text field to button
Hi, you guys.
I have a following coding, I wanna enter on txtKeyword to fire btnDone click , can you help me?
I have a following coding, I wanna enter on txtKeyword to fire btnDone click , can you help me?
<ext:TextField ID="txtKeyword" runat="server" FieldLabel="Keyword"
AllowBlank="false" BlankText="Text is required." EnableKeyEvents="true">
<Listeners>
<KeyPress Handler="if(e.getKey() == Ext.EventObject.ENTER){e.preventDefault(); #{btnDone}.click();}" />
</Listeners>
</ext:TextField>
<ext:Button ID="btnDone" OnClick="btnDone_Click" runat="server" Text="Search"
AutoPostBack="true" Icon="Accept"></ext:Button>