It seems that there are no error handling facility in the Jquery.Form plugin, which is very frustrating. Even though the documentation says we can use the $.ajax options, I
Jquery Form Plugin handle the server response status success (code 200), i think that information is enough.
From that you can create you response status server side
return $this->returnJson(array(
'response' => 'success',//error or whatever
'data' => 'Succesfully saved in the database'
));
of course returnJson is a function to send the Json data (you can build one or doing inside your method)
in the frontend on success handle (is fired when response is 200) you just need to check your status field (in this case 'response'), example below:
var options = {
dataType : 'json',
success: handleResponse
};
function handleResponse (responseText, statusText, xhr, $form){
if(responseText.response == 'success') {
//do something
}else if(responseText.response == 'error'){
//do something
}
}