Hidden Field as HoneyPot
Jörn created the topic: Hidden Field as HoneyPot
Hi there,
I would like to set a hidden field as kind of a honeypot for spam protection. Is there a way to tell the form to just submit if the hidden field is NOT checked/filled?
Thanks in advance,
Jörn
Please Log in or Create an account to join the conversation.
6 years 7 months ago
Agapi G. replied the topic: Hidden Field as HoneyPot
Hello Jörn!
Thank you for posting your request!
There surely is a way to achieve this, just a few lines of additional PHP code is required. Please add your hidden field to your form first, and get the value of its name attribute from frontend.
Afterwards open /form-maker/frontend/models/FMModelForm_maker.php file and search with savedata keyword. You will find the following function:
public function savedata($form, $id) {
Add this code right in the beginning of this function:
if ($_POST["field_name"] != '') {
return;
}
where field_name should be replaced with the value of name attribute of your hidden field. Please see the screenshot below.
Thanks! Have a great day!
Kind regards,
Agapi G.
Web-Dorado team
Please Log in or Create an account to join the conversation.
6 years 7 months ago
Time to create page: 1.939 seconds