Jimmy,
Should I add an array error structs(fieldID, Message) to the JSON
Response, and use the ShowErrors method of the validator?
so far that is the recommended solution. You can see a reference example
here:
http://jquery.bassistance.de/validate/demo-test/ajaxSubmit-intergration-demo.html
The interesting stuff are these lines:
var v = jQuery("#form").validate({
submitHandler: function(form) {
jQuery(form).ajaxSubmit({
dataType: "json",
after: function(result) {
if(result.status) {
v.showErrors(result.data);
}
}
});
}
});
That assumes a response in this format for errors:
{'status': 1, 'data': {'password': 'Your password is wrong (must be foobar).'}}
And this response in the success case:
{'status': 0}
Let me know if you have any idea on how that could be easier to use. Or
if you any issues implementing it.
--
Jörn Zaefferer
http://bassistance.de