E
E
elise2018-04-05 05:45:39
reCAPTCHA
elise, 2018-04-05 05:45:39

How to block form submission until the captcha is fully loaded?

Good afternoon!
I have recaptha on my site for forms, until you touch them, the form naturally does not submit. But after I clicked on it, at that moment while the animation is running on it and until the moment it is completely loaded into the "ready" state, with a green checkmark, I manage to click on the submit form many times, and it fulfills my every click , that is, a bunch of identical submissions from this form fall into the database with a difference of seconds.
Now I check if the captcha is clicked or not by the function:

function captcha_callback(response) {
            if (response.length > 1) {
                //все норм
            } else {
                //показываю ошибку на форме что капча не нажата
            }
        }

Please help me improve, given the jamb

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xmoonlight, 2018-04-05
@xmoonlight

1. By default - do not show submit (change the display only after loading all form blocks).
2. By submitting - before submitting, check the availability of all necessary form objects.
3. After clicking on the submit, at the time of sending the data - hide the submit. After completing the sending process and receiving the result - display again (if necessary).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question