I've tried using this example to prevent my page from getting spam on it, but when I test it out and put text in the field, my submit button is still sending the form out. I use formit for my websites.
The idea is to create a hidden field and if a spambot inserts something into that hidden field, then no email is sent out.
Example in question
Snippets of the code
<input type="hidden" name="workemail" value="" />
[[!FormIt? &validate=`workemail:blank`]]
I'm using the exact code from there, and the code below is my field - I've made sure the field is within the tags.
<input type="hidden" name="workemail" value="[[!+fi.workemail]]" />
my formit code looks like
[[!Formit?
&hooks=`spam,FormItSaveForm,email,redirect`
&redirectTo=`122`
&formName=`Contact Form`
&formFields=`fname,title,company,email,options,subject,message`
&emailTpl=`fi-contact_email`
&emailSubject=`[[*contact_email_subject]]`
&emailTo=`[[*contact_email_to_address]],[email protected]`
&emailFrom=`[[*contact_email_from_address]]`
&emailFromName=`[[*contact_email_from_name]]`
&emailReplyTo=`[[+email]]`
&submitVar=`contactform`
&validate=`workemail:blank,
fname:required,
email:email:required,
message:stripTags,
username:blank`
]]
Any help is appreciated, thank you!
Maybe something of the following will work out:
0) First of all, update MODX and FormIt extra and try again.
1) If the problem persists, try to remove
[[!+fi.workemail]]
from thevalue
attribute.2) If the previous step didn't help, add another field to your form. So, it should be:
3) Also try to remove
workemail
stuff from both the markup and formit call and instead addAlternatively, take a look at other options like ReCaptchaV2