Extension

Archived
Forum
(read-only)

Snaptcha

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

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

     

Resetting form on page load causes form submission to fail

Support (Resolved)

elsmore
elsmore

I have an AJAX cost calculator Freeform form that I want to reset (clear) if a user hits the browser refresh button. Without the reset script the form works, but If I use the reset script it doesn’t submit (throws the Snaptcha error). Here’s the script:

$(document).ready(function () {
      resetForms
();
});
    function 
resetForms() {
      document
.getElementById('configurator-form').reset();

If I reduce Snaptcha security level to low, the forms work again ok.

Any idea how I can fix this? The site is not live yet, so I’d need to provide a login if you need to see the form.

Snaptcha 1.7.6, EE 2.9.2

PutYourLightsOn
# 1
PutYourLightsOn

using the reset function will clear all fields in the form including the snaptcha field which is why the error is thrown. you’ll need to either manually reset the form fields or restore the snaptcha field value. make sense?

elsmore
# 2
elsmore

Ok, makes perfect sense thank you!

PutYourLightsOn
# 3
PutYourLightsOn

great, glad to help!!