I've been using almost the same technique for about 7yrs.
It uses a combo of javascript and server side regex to verify human users.
The javascript sets a special word into a hidden form field. You can use jQuery inside of User Defined Tag to make this easy. (jQuery library is required of course and needs to load before the snippet):
I place calls to jquery at the bottom of my page, so I just put this into my on doc ready javascript:
Code: Select all
<__script__ type="text/javascript">{literal}
$(document).ready(function(){
$("#antispam").val("antispam");
});
{/literal}</__script>
It can also be printed from a UDT and then called into the form using the UDT options for formbuilder. Anyway, it just writes the word, "antispam" or whatever word you choose, into the a field with an ID of antispam...
Next, in formbuilder, create a hidden field called, 'antispam' - I hide using the form options and with CSS by setting a class for it.
Set an ID in the field options called, 'antispam'
Then, use some validation rules to check if the antispam field contains the correct word entered during form submission.
regex:
or replace 'antispam' with your own word....
Save the field settings.
Generally, spam bots are command line or some other interface that doesn't parse javascript. And, a spammer wants to fill in every empty field. So, when a spam bot comes by, it will fill in the field with something other than what the regex specifies and then the form is not submitted. Spam has not been a problem with this at all.
A question often asked is what if the user doesn't support javascript?
I used to care that some people may have javascript turned off and would not be able to send via a form. But, it is such a low percentage now. It hasn't been an issue for 100's of site's using this type of approach. Also, most legitimate sites will have an email address provided somewhere on the contact page or in the footer/header, so if a non-javascript user was stuck, they would still have the means to contact....
But, really, just an empty field with regex checking that it is empty upon submission would be sufficient. I've just been doing it with JS out of habit
