I create my form in ModX with FormIt:
[[!FormIt?
&hooks=`email`
&emailTpl=`registerEmailTpl`
&emailSubject=`New Registration on Huayang English Website`
&emailTo=`[email protected]`
&successMessage=`Your application has been successfully sent to Huayang.`
&emailFrom=`[email protected]`
&emailFromName=`Huayang School`
&submitVar=`registerForm`
&validate=`given_name:required,
family_name:required,
birthday:required,
gender:required,
address:required,
city:required,
state:required,
country:required,
zip:required,
email:required,
phone:required,
passport_number:required,
place_of_issue:required,
date_of_issue:required,
expiration_date:required,
campus:required,
class_type:required`
]]
The issue is that I always get a validation error, even if I input information for all required form inputs. The weird thing is that the form seems to validate: the success email is sent and the [[!+fi.successMessage]]
is shown. But on the other hand, the [[+fi.validation_error_message]]
is shown too and [[!+fi.validation_error]]
equals to 1
. [[+errors]]
is empty though as well as [[!+fi.error]]
which is supposed to contain the validation errors..
So, it seems the form is validating and not validating at the same time.
How can I debug the form and find where the validation error comes from?
Are there multiple forms on the page that might be clashing? If so try setting another &prefix for one of the FormIt's.