PDA

View Full Version : textfield keypress listeners



okutbay
Feb 04, 2010, 10:21 AM
How can i show this alert only enter pressed?

Thanks in advance



<ext:TextField ID="txtEMail" runat="server" EmptyText="E-Posta Adresinizi yaziniz."
FieldLabel="Kullanici Adi" AllowBlank="false" BlankText="E-Posta bos birakilamaz!"
EnableKeyEvents="true">
<Listeners>
<KeyPress Handler="Ext.Msg.alert('enter','enter');" />
</Listeners>
</ext:TextField>

Vladimir
Feb 04, 2010, 10:41 AM
Hi,


<KeyPress Handler="if(e.getKey() == Ext.EventObject.ENTER){Ext.Msg.alert('enter','ente r'); e.stopEvent();}" />

okutbay
Feb 04, 2010, 10:41 AM
<KeyPress Handler="if(window.event.keyCode == 13) {Ext.Msg.alert('enter', 'enter');}" />


is there another way to write in extjs?

aniketyadav7
May 04, 2010, 3:39 AM
Thanks for this forum guys...i was unable to handle the enter key event...but this forum helped me a lot...Thanks very much