PDA

View Full Version : Form submits and waits for ever on bad response



stratis
23 Apr 2007, 1:30 PM
Sorry for my english....
Based on your examples i try to submit a form on a CFM page (coldfusion). When the url is wrong i get a "Failure Client" dialog box with "Validation failed" message, that seems ok. When in CFM page return {success:true} then success: function(){alert("ok");} is called and this is ok. Now when i return garbage from CFM, or whitespaces (only) i get a "Please wait..." that loops forever.... and i don't like it.
I noticed in FF's debug console that an error is logged that has to do with the data i returned.... my question is how can i handle this error? i tried to handle it with

frmNewOrg.submit({
waitMsg: 'Processing Data, please wait...',
//reset: true,
reset: false,
success: function () {alert('sucess');},
invalid: function(f,e) {alert('invalid');},
failure: function(f,e) {
if (e.failureType == 'server') {
Ext.Msg.alert('Failure server', 'id:' + e.result.errors.id + ' - msg:' + e.result.errors.msg);
} else {
Ext.Msg.alert('Failure client', 'Validation failed');
}
},
scope: frmNewOrg,
// add some vars to the request, similar to hidden fields
params: {action: 'new'}
});

but no progress invalid:, failure: cases are not called in any of the cases above...
but success is called, seems that normal? how can i handle errors in bad responses from server?
thx in advance...

jsakalos
23 Apr 2007, 2:17 PM
I also had this...

server has to respond with {success: true} or {success:false,errors:'error description'}.

Hope it helps.

stratis
23 Apr 2007, 4:34 PM
now i check in coldfusion and trying to find the posted data but no data are posted? nothing.....!:((