我在一个页面中使用两个recaptcha,这个页面有两种形式供不同的用户使用。recaptcha.destroy()在自定义主题中不起作用
我使用自定义主题,使用AJAX API创建的验证码为:
function showRecaptcha(element) {
Recaptcha.create(
'publice_key',
element, {
theme: 'custom',
callback: Recaptcha.focus_response_field
});
}
我用它在两种模式:
$("#to-teach").click(function() {
$("#sign-up-welcome").hide();
teachForm();
showRecaptcha('teachcaptcha');
return false;
});
,另一个用于
$("#to-student").click(function() {
$("#sign-up-welcome").hide();
studentForm();
showRecaptcha('studentcaptcha');
return false;
});
teachForm()
是:
function teachForm() {
Recaptcha.destroy('studentcaptcha');
signup.show();
signupTitle.text("Sign Up as a Teacher");
}
和类似摧毁作为Recaptcha.destroy('teachcaptcha');
和HTML为定制验证码事件是:
<div id="teachcaptcha">
<div id="recaptcha_image"></div>
<div class="captcha-input-box">
<input type="text" id="recaptcha_response_field" name="recaptcha_response_field" class="input-recaptcha" />
<a class="fontawesome-refresh" href="javascript:Recaptcha.reload()"></a>
<a class="fontawesome-headphones recaptcha_only_if_image" href="javascript:Recaptcha.switch_type('audio')"></a>
<a class="fontawesome-picture recaptcha_only_if_audio" href="javascript:Recaptcha.switch_type('image')"></a>
<a class="fontawesome-question" href="javascript:Recaptcha.showhelp()"></a>
</div>
</div>
,同样为studentcaptcha
的问题是,如果我使用white
主题而不是custom
并且不要放任何自定义html在<div id="studentcaptcha" or "teachcaptcha">...</div>
破坏()最好,但它根本不工作时,我使用custom
主题,并把我自己的HTML div
。
有什么建议吗?