George, I'm just getting started, but I have something working like what you're talking about. I'm using the 'jsonschema' Python package to do server-side validation. I set up my server side code to return a JSON-encoded entity that has the same structure as the error objects that Backbone generates itself during validation. If I'm remembering right, that structure is an array of error objects, and each object has a property where the name of the property is the name of the attribute that failed validation, and the value is the error message -- something like this:
[{address: 'Must be less than 40 characters'}, {zip: 'Invalid zip code'}]
(Please double-check this - I'm pretty sure it's correct but, you know, I'm new, blah blah).
In any case, having received the error object at my 'error' callback from the 'save' call, I convert the responseText to an object (jQuery $.ajax will *not* automatically decode a returned entity of Content-Type:application/json if the status code indicates an error). I then borrowed some logic from around line 250 of backbone-forms.js to set the error messages on the various fields -- here's my variant:
// Given a form ana a list of errors, show the ones associated with
// form fields, and return the ones that weren't.
function show_form_errors(form, errors) {
var others = []
_.each(errors, function(message, key) {
if (form.fields[key]) {
form.fields[key].setError(message)
} else {
others.push(message)
}
})
return others
}
"others" are the errors whose property names didn't correspond to field names. You'll have to decide what to do with those (I show 'em in a popup dialog).
I hope this is helpful, but please do take it with a grain of salt, as i've only been using Form for a couple of days. Perhaps more experienced folks here will jump in and help us both figure out a better way to do this.