PDA

View Full Version : form submit response



Dmoney
4 Jan 2011, 9:13 AM
I'm having trouble displaying the response I receive from a submitted form.



failure: function (form, action) {
console.log(action.result);
var message = Ext.util.JSON.decode(action.result);
Ext.MessageBox.alert('Failed', message.messageText);
}


the response I get in the console is :
Object { success=false, messageText="Error: already exists"}

but I get this error in firebug:

missing ] after element list
[Break On This Error] ([object Object])

4 Jan 2011, 10:21 AM
I'm having trouble displaying the response I receive from a submitted form.



failure: function (form, action) {
console.log(action.result);
var message = Ext.util.JSON.decode(action.result);
Ext.MessageBox.alert('Failed', message.messageText);
}


the response I get in the console is :
Object { success=false, messageText="Error: already exists"}

but I get this error in firebug:


{ success=false, messageText="Error: already exists"} is not valid json