Hi,
Currently working on a project with some extended forms. I got almost everything working now. The form works fine, all the fields got processed and emailed to me. Only I'm running into a small problem; I'm using a jQuery validation on the forms, got the formIt validation also build in as a secondery validation. Only i'm getting the following problem:
- After submitting, the form is validated by jQuery before formit is processing the form. This go's just fine and everything got proccessed and emailed. Only the redirect hook isn't working/triggered. Below are some details on my form:
MODX version: 2.3.3
Formit version: 2.2.6
Formit call(only the redirect):
&hooks=`spam,email,redirect`
&redirectTo=`2`
After submitting the form, i'm using the following code;
onSubmit: function(invalid, e) {
e.preventDefault();
if (invalid) {
alert(invalid +' fields!');
}
else {
$.post( "[[~[[*id]]]]", this.$form.serialize() );
}
}
As I said, everything works fine, only the redirect isn't triggered/working. I tried it without the jQuery validation and the redirect is working fine then, so it's no error on the formIt side. I'm not realy a JS expert, so hoping someone here can put me in the right direction.