someone please explain to me how to insert honeypot in views exposed filters
please help

Comments

geerlingguy’s picture

Status: Active » Closed (works as designed)

Please see the example here: #2109509-1: How to get honeypot on an event registration form for Entity Registration.

Basically, you can create a custom module, like 'custom.module' (It will also need an .info file), and put something like the following inside the .module file:

function custom_form_alter(&$form, &$form_state, $form_id) {
  if ($form_id == 'form_id_you_are_interested_in') {
    honeypot_add_form_protection($form, $form_state, array('honeypot', 'time_restriction'));
  }
}

You can find the form ID by viewing the source on the page with the views exposed form, and search for the text "form_id" — the name of that HTML element will be what you put in for 'form_id_you_are_interested_in'.

That's the simplest way, if you want to avoid turning on Honeypot for every form on your site!