View Full Version : standardSubmit issue

8 Sep 2009, 11:31 AM
3.0 still having issues with standardSubmit? Saw a few post about this and I am unable to get it going. I hit submit and it just refreshes the page.

var form = new Ext.FormPanel({
standardSubmit: true,
url:'submit.cgi' (http://www.extjs.com/forum/'submit.cgi'),
bodyStyle:'padding:5px 5px 0',
items: [{

var win = new Ext.Window({
autoScroll: true,
border: false,
items: [form],
buttons: [{
handler: function(){
//~ win.destroy();
text: 'Close',
handler: function(){

8 Sep 2009, 12:07 PM
http://www.extjs.com/deploy/dev/docs/?class=Ext.form.BasicForm (http://www.extjs.com/forum/../deploy/dev/docs/?class=Ext.form.BasicForm)

This is where standardSubmit comes from.

Unfortunately, it doesnt seem to mention that the "basic submit" is somewhat asynchronous.
Unlike a "regular" form, submitting through standardSubmit does not load the serverside page at all. It just submits like you would expect, throws away the response, and reloads the url it came from (AFAIK).

What you want is:

I think.

8 Sep 2009, 12:14 PM
To prevent any scope issues, and to correct the call,

var frm = new Ext.form.FormPanel( {...

And what you probably need is

...handler: function() {
Ext.Ajax.request( {
url: "submit.cgi",
params: frm.getForm().getValues(),
success: function() {...},
failure: function() {...}
} ) ;

And when you destroy the window, you are also destroying your form panel. I hope this is all called inside a function, or you won't be able to open it again and see any contents. Or, you can just use win.close() with closeAction: "close" in your window config.

24 Jun 2010, 4:01 AM
Realizing that the previous post to this thread was almost a year ago, I thought I'd reply in case it helps someone else:

I encountered this same problem with ExtJs/Sencha version 3.2.1 and found that for some reason, my form was failing validation, so the standard submit action was being canceled. No fields were highlighted in red and all field values appeared to be valid, but validation was still failing. To get around the problem, I disabled "clientValidation" and the submit worked like a champ.

myForm.getForm().submit({clientValidation: false})