Hello all,
Question
I am planning on using the following method to prevent spammers submitting comments. In my Jot-form i have a field (input) wich is hidden by css. When submitted it should remain empty. A php-snipppet should check if the input is empty. But a bot doesnt see it is hidden and fills it with spam. When the bot submits it, the php-snippet should prevent it being submitted. More about this method can be found here:
Fighting Spam with CSS
Sottwell implemented this method in her
eform contactform. She explained how she did this here:
http://modxcms.com/forums/index.php/topic,25391.0.html
Sotwell mentioned it isnt waterproof, but it should at least stop some spam-bots.
The (hidden) input in my case formatted this way:
######### XHTML #########
<label id="Lastname">Do <strong>not</strong> fill in this field!<br />
<input type="text" name="Last__Name" size=30 />
</label>
######### CSS #########
#Lastname {
background-color:red;
height:1px;
width:1px;
top:-500px;
left:0;
overflow:hidden;
position:absolute;
text-decoration:underline;
}
As you can see, the label is hidden from public with CSS. If someone happens to have a CSS-disabled browser they see the message not to fill it in. Bots should not be so smart to find out its hidden..
this is the snippet he uses (called: checkField) :
<?php
function checkField(&$fields,&$vMsg,&$rMsg) {
if(!empty($fields['Last__Name'])) {
return false;
} else {
return true;
}
}
?>
and the eform call (the relevant part)
[!eForm? &formid=`Form` [...] &eformOnValidate=`checkField`!]
However, I want to use this method for Jot. I can not find a parameter similar to &eformOnValidate to run the snippet for Jot.
So my question is: How to run the snippet when the form is submitted, but before it is placed.