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

#83501

Please Log in or Create an account to join the conversation.


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
#83569
Attachments:

Please Log in or Create an account to join the conversation.


Time to create page: 1.939 seconds
Powered by Kunena Forum

WORLD-CLASS SUPPORT

We are here for you every step of the way. Turn to our support with any questions you might have about our products and services. Our experienced customer care team is available to help you as fast as we possibly can.

Contact us