Summary
I’ve installed FormIt (4.2.5) on my site (2.7.1). I’ve set everything up as per the Simple Contact Form example https://docs.modx.com/current/en/extras/formit/formit.tutorials-and-examples/examples.simple-contact-page
I have installed and run QuickEmail which works fine.
I also created a quick PHP email process script myself, which also works fine.
Lastly I turned off mod_sec.
Step to reproduce
Set up form as per tutorial minus recaptcha https://docs.modx.com/current/en/extras/formit/formit.tutorials-and-examples/examples.simple-contact-page
My FormIt call looks like:
[[!FormIt?
&hooks=`spam,email,redirect`
&emailTpl=`EmailTPL`
&emailFrom=`noreply@mysite.com`
&emailFromName=`Me`
&emailTo=`me@mysite.com`
&redirectTo=`7`
&validate=`name:required,
email:email:required,
text:required:stripTags,`
]]
My form chunk looks like:
[[!+fi.validation_error_message:notempty=`<p>[[!+fi.validation_error_message]]</p>`]]
<form action="[[~[[*id]]]]" method="post" class="form">
<input type="hidden" name="nospam" value="" />
<label for="name">
Name:
<span class="error">[[!+fi.error.name]]</span>
</label>
<input type="text" name="name" id="name" value="[[!+fi.name]]" />
<label for="email">
Email:
<span class="error">[[!+fi.error.email]]</span>
</label>
<input type="text" name="email" id="email" value="[[!+fi.email]]" />
<label for="subject">
Organization (optional):
<span class="error">[[!+fi.error.businessName]]</span>
</label>
<input type="text" name="businessName" id="businessName" value="[[!+fi.businessName]]" />
<label for="text">
Message:
<span class="error">[[!+fi.error.text]]</span>
</label>
<textarea name="text" id="text" cols="55" rows="7" value="[[!+fi.text]]">[[!+fi.text]]</textarea>
<div class="form-buttons">
<button class="btn btn--primary" type="submit">Send</button>
</div>
</form>
Observed behavior
Nothing happens - no validation, no redirection, no email sent, no console errors.
Expected behavior
I expect validation to work, page to be redirected and email sent.
Environment
FormIt (4.2.5), MODX (2.7.1) on LAMP stack.
Any help is much appreciated! Many thanks!