ExpressionEngine 2, ExpressionEngine 3, ExpressionEngine 4, ExpressionEngine 5, ExpressionEngine 6

Back to this add-on's main page
View Other Add-ons From PutYourLightsOn


You must be logged in to post.

Snaptcha working on some forms, not on others

Support (Resolved)

Rick Lecoat
Rick Lecoat

I’m using the latest version of Snaptcha (3.1.1 at time of writing) with EE 6.0.3. I’m making use of EE6’s new in-template tags for things like login forms, account registration forms, password reset requests, etc.  Thing is, I’m finding that with some of my forms Snaptcha works, and with some it doesn’t. The forms that I’m trying to use it on are: Registration, Contact, Login, Reset/Forgot password, and the Cookie Consent accept/reject form. With the exception of the Contact form (which is actually a FormGrab form), all of these use native EE6 in-template tags; none of them use the legacy membership-related forms.

The FormGrab-powered contact form is the only one out of the set where Snaptcha is automatically recognised; all the others needed the Snaptcha field to be added into the just inside the end of the form. That’s okay, I was pretty-much expecting that (although TBH I was surprised that FormGrab was recognised automatically, since I don’t think it’s on the list of compatible forms in the Snaptcha docs).

Out of all these forms, the ‘FormGrab’ contact form and the ‘Register An Account’ form both work correctly with Snaptcha—ie. when I fill them out and then delete the Snaptcha input field using the web inspector before submitting the form, the submission fails with Snaptcha’s alert message (as it should).

With the other forms, even though I can see the Snaptcha input in the web inspector, deleting the input does NOT cause the form submission to fail; I am, instead, taken to the normal Return page for that particular form. This is true regardless of whether I am in ‘Guest’ mode or logged in as a member. (Exception: the login form, which is unavailable for logged in members).

I’ve tested this on my local installation (EE 6.0.3, PHP 7.2.22, MySQL 5.7.26, running inside MAMP Pro on Mac OS) and on a remote pre-staging server, and I get the same results in both environments.

Any suggestions on how I can get Snaptcha working on all my forms?

# 1

Snaptcha is not enabled on the login or reset password form because neither of these forms is susceptible to spamming since they both require authentication of one type or another.

FormGrab compatibility was added in version 2.1.0 but was missing from the docs, I’ve fixed that.