Can anyone please recommend a way I can get form protection to work on exposed view filters?

I'm trying to protect a views_exposed_form from spam with honeypot, but am runnning into the same issue of "There was a problem with your form submission. Please wait 5 seconds and try again." The message appears right when the page loads and the form hasn't even been submitted yet. And every time the page is refreshed the number of seconds to wait multiplies. I am using a page view with a views attachment with ajax enabled in those views. I've been adding the honeypot_add_form_protection in a views_form_alter within my template.php. It works fine with just the hidden text field, but the time restriction is what I really need. Any help would be greatly appreciated.

I'm specifically using the Openlayers Locator Feature at https://drupal.org/project/ol_locator, but it seems that bots are constantly submitting the views exposed filter form and causing it to exceed the Google Geocoder limits of 2,500 requests per day since it looks like the Openlayers Locator Feature doesn't currently validate addresses before it submits to Google's Geocoder.

Comments

geerlingguy’s picture

The problem with time-based protection on an AJAX form is that AJAX forms often submit many times in a short period of time (for example, while you're typing into an autocomplete field, that field will submit the form every time you type a letter and then pause for X seconds).

Time-based protection might not be the best solution for AJAX forms, I think.

urlM’s picture

I'm not using an autocomplete field. AJAX is only being used to reload the result without a page refresh. I've added the hidden Honeypot field, but something tells me it could be an issue going on with the Openlayers Proximity module. I've moved this post over to: https://drupal.org/node/1462098 concerning the Google Maps Geocode limit.

geerlingguy’s picture

Status: Active » Postponed (maintainer needs more info)

Okay, in that case, please set this back to active once you get somewhere on that other issue.

urlM’s picture

Okay. Thank you.

geerlingguy’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Going to close this issue for now; please re-open if you are still having the problem and it's not resolved by #1462098: Google Maps Geocode Limit?.