I cannot seem to install this. It appears to download OK, but when I hit install, it pops up "Package Not Found". Tried multiple times.
Is there an easy way to integrate JS validation with Formit so the built-in (and custom) validators do the validation, but it’s done prior to submission?
How can a custom hook (snippet) return error messages? There’s no $this->errors[] to attach them to.
Would it make sense to send a reference to the fiHooks class instance as an argument to them?
[UPDATE] Never mind, I see it’s already there in the properties. I forgot for a second that I was working with geniuses.
If you return the array (instead of false), won’t Formit interpret that as success and proceed to the next hook in the list (possibly redirect)?
Wouldn’t it be better to return false and set the error placeholders in the form?
Quote from: splittingred at Feb 26, 2010, 07:42 AM
Quote from: BobRay at Feb 25, 2010, 11:57 PM
If you return the array (instead of false), won’t Formit interpret that as success and proceed to the next hook in the list (possibly redirect)?
Nope - it only interprets it as success if you return true.
Right. I was looking at the wrong bit of code.
Is this accurate?
If any hook doesn’t return true, the hooks after it in the &hooks parameter won’t execute.
If a hook isn’t found, the hooks after it *will* execute.
BTW, for the spam hook, the &spamEmailFields parameter doesn’t seem to be required (since it defaults to ’email’). Do you want me to fix that in the docs?