The API explains that you must pass success: true for the calling success handler. This is the document for submit method.
Options@param {Object} Parameters for transition to action (for more details see Ext.form.Basic.submit and Ext.form.Basic.doAction)
if (form.isValid()) {
If you want to use another property to indicate an error, you should examine http://docs.sencha.com/extjs/4.2.0/#!/api/Ext.form.Basic-cfg-errorReader , you can configure errorReader to read your property as you would like.
You can also route both your successful and error handlers to the same place and define it from the handler
Be sure to set standardSubmit:true so that it is not transmitted using AJAX
An example solution that will make your code a little less dirty
Ext.define('ns.my.CustomReader', { extend: 'Ext.data.reader.Reader', alias: 'reader.ns-customreader', read: function(xhr) var resp = Ext.JSON.decode(response.responseText, true); // Handle the case where response is not JSON too (unhandled server errror?) return {success: resp ? !!resp.id : false}; } });
Then, when you create the form, you can simply use
form : { errorReader: 'ns-customreader' }
I also noticed that you are not returning the record that the reader should do according to the documentation, maybe you just do not need it, but it would be nice to satisfy the interface so that the code is in accordance with Ext-JS
ErrorReader does not have to be a full-blown Reader implementation. You just need to implement a read function (xhr), which returns an array of records in an object with the following structure:
{ records: recordArray }
source share