I've never tried this, because I always create my own processor for ajax form.
This is my thought:
Expecting procedures:
1. submit button, page stays still
2. jQuery collects the form's serialized valued
3. send to processor
4. return the respond, preferably in JSON
There's no way you can get the expected respond from FormIt, because it doesn't return anything on success and return text format on error. It does not have any respond formater.
But if u want to try it:
1. put the FormIt call in a resource, with empty (0) template. Add its error placeholder just right after it.
2. On your jQuery,
$.ajax('index.php?id=put_the_id_of_that_resource', {
[place all arguments you need for your hook]
});
3. If, and only if, there's a respond on .done(response) callback, it means the error placeholder is filled up. It means it's returning error. Otherwise, it's succeeded.
I've never tried this, but I hope this makes sense.
[ed. note: goldsky last edited this post 10 years, 1 month ago.]