For my website I'm loading all subpages in a div that basically covers everything but the menu via jquery. The structure is like this, you press the account button, and you get the log-in form, then there's a link(that fires an onclick function) to the registration page.
I first introduced the captcha to the reg page, via the easiest method, because I couldn't get anything else to work. Everything was fine, until I added captcha to the log-in page, now the registration page doesn't render it and I get an "Uncaught Error: ReCAPTCHA placeholder element must be empty" error.
Here's how the captcha is loaded on both pages:
<script src='https://www.google.com/recaptcha/api.js'></script>
<div id="captcha" class="g-recaptcha" data-sitekey="6LeNGScO_"></div>
The same thing on register.php but via echo
this is the function that shows the registration page
function goregister()
{
grecaptcha.reset();
page = 4;
var element = "#mbody";
var link = "/php/register.php";
$(element).load(link);
}
I even tried adding an id to the captcha div and setting it's innerhtml to "" but it still won't help.