16 Apr Prevent Email Spam on Forms
You can see my email address set up in the hidden To input field.
Step 1: Change To field to a spam email catching address
We will set up a dummy gmail address and then add it to the To input field. For example:
Step 2: Create a radio button question
Add a question at the bottom of the form. For example, we usually put: Please help us prevent spam by answering this question: I am a spambot I am a human By default the I am a spambot radio button is selected, and the form won’t be submitted until the user selects I am a human. We use the JQuery Validate plugin for form validation and include this question as part of the validation. Form validation is a much larger topic than this, so for now we will stick the email issue.
Step 3: Add JS to switch email addresses on submit
Our final form looks like this:
Latest posts by Kara Noreika (see all)
- Common Drop Down List Data for WordPress Contact Forms - March 18, 2016
- Prevent Email Spam on Forms - April 16, 2014
- Use Google Fusion Tables to Display and Map Data - February 8, 2014