简体   繁体   English

Recaptcha.reload()将表单的焦点重置为验证码。 需要禁用

[英]Recaptcha.reload() resets the focus of my form to the captcha. Need to disable

When my form fails validation, it executes this block of js: 当我的表单验证失败时,它会执行以下js块:

Recaptcha.reload("t");

$(document).scrollTop( ScrollY.top - 10 );
$(firsterror).focus();

From what I've read at the google forums, the 't' parameter should disable the focus on the captcha, but it seems to have no effect. 根据我在谷歌论坛上看到的,'t'参数应该禁用焦点在验证码上,但似乎没有效果。

I don't want it to focus on the recpatcha, as I have other fields further up the page that have also failed validation. 我不希望它专注于recpatcha,因为我在页面上还有其他字段也验证失败。

You could use the internal reload function that Recaptcha uses, like so: 您可以使用Recaptcha使用的内部重新加载功能,如下所示:

Recaptcha.reload_internal('t');

This will stop Recaptcha from focusing the field after any invalidity. 这将阻止Recaptcha在任何无效后重点关注该领域。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM