PDA

View Full Version : form success issue



raj_plays
22 Mar 2010, 6:59 AM
Hi,
My form has...

buttons: [{
text: 'Save',
handler: function(){
if(formPanel.getForm().isValid()){
formPanel.getForm().submit({
waitMsg: 'Uploading image...',
success: function(form, action){
Ext.MessageBox.alert('Success', 'Processed file');
},
failure: function(form, action){
Ext.MessageBox.alert('Error', 'Unprocessed file');
}
});
}
}
}]

and my server side function (web service in .Net)....

[WebMethod(EnableSession = true)]
[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
public string uploadImage()
{

return "{\"failure\": true}";
}

But, it shows the success message everytime.
Can anyone help?

Condor
22 Mar 2010, 7:05 AM
return"{\"failure\": true}";

Shouldn't that be:

return"{\"success\": false}";

raj_plays
22 Mar 2010, 10:52 AM
Thanks for replying, Condor.
I made the change but it still shows the success message.