Honeypot condition in Forms - or is the hidden field for that?

It would be good to have a honey pot in the forms

5 Likes

I’m playing, and I’m not an expert. What is written below is a working solution, but wrong. There should be actions and filters. But I do not know how or impossible at the moment.

bricks\includes\integrations\form\init.php

before line // Google ReCAPTCHA v3 (invisible)
add code

      if (! empty ($_POST['email']) ) {
        wp_send_json_error(
          [
            'code'    => 400,
            'action'  => '',
            'type'    => 'danger',
            'message' => 'spam',
          ]
        );
      }

bricks\includes\elements\form.php
before line // Submit button icon
add code

            <?php echo '<input type="text" name="email" id="form-field-email" style="display:none !important;">'; ?> 

Indeed, it is necessary to have a HoneyPot field for the forms. Elementor has one and we are not going to be left behind with Bricks. Programmers, you can!

Does this help?

1 Like