-
4 Aug 2011 9:24 AM #1
submit a form using a listener
submit a form using a listener
Hi,
I am trying to use the following inside a form
But nothing happens when I press enter in Safari (which simulates the standard submit).Code:listeners:{ submit: function( myThis, submitResult ) { alert('submit'); }
What am I doing wrong?
-
4 Aug 2011 11:06 AM #2
Does clicking the button fire the event? I think you actually have to wire the enter key to perform the submit with Touch.
-
4 Aug 2011 11:19 AM #3
The Enter Button fires the standardFormSubmit.
But I would prefer to fire the button handler on Enter.
-
5 Aug 2011 1:17 AM #4
Hi, you have to listen on every field in the form, add this listtener to every field:
Code:listeners: { keyup: function(fld, e){ if (e.browserEvent.keyCode == 13 || e.browserEvent.keyCode == 10) { e.stopEvent(); fld.fieldEl.dom.blur(); // Hide keyboard window.scrollTo(0,0); // Scroll to top yourForm.submit({ waitMsg : {message: 'Submitting...', cls : 'loading'} }); } } }


Reply With Quote