PDA

View Full Version : [1.1RC1] form.submit parms property performs GET + POST



jay@moduscreate.com
11 Jul 2007, 7:44 AM
Posting minimal code because this can be recreated anywhere; detected via fireBug:



inputForm = new Ext.form.Form({
labelAlign: 'right',
method: 'POST',
url: 'testpage.php',
labelWidth: 80
});
inputForm.add(
new Ext.form.TextField({
fieldLabel: 'Host ID',
id: 'hostid',
name: 'hostid',
width: 240
})
);

inputForm.render('myForm');


...
submitForm : function () {
if (inputForm.isValid()) {
Ext.MessageBox.wait("Peforming Actions...", 'Please wait');
inputForm.submit({
// callback handler if submit has been successful
success:function(form, action){
Ext.MessageBox.hide();
Ext.MessageBox.alert('<img src="/img/toolbar/silk_icons/icons/accept.png"> Success', action.result.msg);
DLG_dns_form.hideDialog();
DNSQueryDataGrid.refreshGrid();
},

// callback handler if submit has failed
failure: function(form, action) {
Ext.MessageBox.hide();
Ext.MessageBox.alert('<img src="/img/toolbar/silk_icons/icons/exclamation.png"> Failure', action.result.msg);
},
params : { action : formAction }
});
}
...
if (inputForm.isValid()) {
Ext.MessageBox.wait("Peforming Actions...", 'Please wait');
inputForm.submit({
// callback handler if submit has been successful
success:function(form, action){
Ext.MessageBox.hide();
Ext.MessageBox.alert('<img src="/img/toolbar/silk_icons/icons/accept.png"> Success', action.result.msg);
DLG_dns_form.hideDialog();
DNSQueryDataGrid.refreshGrid();
},

// callback handler if submit has failed
failure: function(form, action) {
Ext.MessageBox.hide();
Ext.MessageBox.alert('<img src="/img/toolbar/silk_icons/icons/exclamation.png"> Failure', action.result.msg);
},
/* ******* here ********* */
params : { action : formAction }
});
}

jay@moduscreate.com
11 Jul 2007, 11:53 AM
http://www.tdg-i.com/extexamples/bug_screenshots/get_post_bug_custom_code.wmv