Buy Now
Sign in

Troubles with noCaptcha with ajax

slon777 , February 03 2017
Hi everyone, especially Bob!
I have found another troubles and they deal with AJAX. Look, I have form with google nocaptcha validator. Now, image, I fill all fields in form and forgot to use repactcha and click submit button. Of couse it returns me the error with message about wrong validation. So, when I do it without ajax, it completely reload the whole page and show recaptcha again, but when I do it with ajax, it returns me everything but captcha doen't appear again -> it disappears.
Can anyone help me with this problem?
HI sion777,

Not sure about this, I'll try to take a look. I think it needs some way to validate that ReCaptcha has been checked - I have a feeling that we've looked at this before, I'll have to go hunting.

ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
Hi Bob,
Thank you for suggestions. I have tried to find solution with custom validation of reCaptcha, but in firebug found error: "placeholder element must be empty". Then I have found this silution: you have to put this code in onLoad

<script src="" async defer></script>

Now, I understand that this is Google's problem

But I have still another problem with WYSIWYG editor, which also disappears after reload form with ajax. Test area with text and html tags appears but without visual editor... Now, I'm looking for any solutions...

By the way, have a perfect hunting!!!
Thanks sion777, your solution worked for me as well!

Only problem I have in this case, that 2 hidden fields lose their value. But that is the smallest of the problems :-)

Cheers, Peter
@slon777, I tried adding "Custom Code" to the "onLoad" event at the very top with the script you mentioned, but now I get the "placeholder element must be empty" error every time the page loads!
I fixed the issue by moving the script to the top of the "onFail" event inside the "Check Google noCaptcha" event which is inside the "onSubmit" event.
Perfect!, thank you so much this totally solve the issue... there are other fourms with this some issue, and the problem always was google... thank you again​
when i use this solution I have the below error in the debuger console
reCAPTCHA couldn't find user-provided function: onloadCallback