View Full Version : [CLOSED][3.??] failure function not triggered by JSON response

22 Jun 2009, 12:54 PM
My backend returns the following JSON

{"success":"false","errors":"Bad stuff"}

but to have my form submit failure function triggered I needed to make the following change to the ext-all-debug.js code as result.success is the string "false" which evaluates to true on the right side of the or expression.

@@ -35524,7 +35524,7 @@ Ext.extend(Ext.form.Action.Submit, Ext.form.Action, {
// private
success : function(response){
var result = this.processResponse(response);
- if(result === true || result.success){
+ if(result === true || result.success == 'true'){
this.form.afterAction(this, true);

Is this a bug or is my JSON response incorrect?

22 Jun 2009, 7:08 PM
Your response is incorrect. Why return a string literal for a boolean value?

23 Jun 2009, 1:59 AM
Thanks. I will fix my JSON response.