简体   繁体   English

如何在移动设备上禁用reCAPTCHA的联想文字?

[英]How do I disable predictive text for reCAPTCHA on mobile?

I'm using reCAPTCHA on a sign-up form. 我在注册表单上使用reCAPTCHA。 On mobile devices it's annoying as the phone constantly suggests dictionary words while you're typing. 在移动设备上,这很烦人,因为您在键入时手机会不断提示字典单词。

I know how to turn this off for normal input fields, and I could probably do it by running some javascript after it's rendered and adding attributes to the input field - but...surely this should be off by default (as it's useless 99% of the time), or at least easy to configure to an 'off' setting? 我知道如何针对正常的输入字段关闭此功能,我可以通过在呈现后运行一些javascript并将属性添加到输入字段中来实现此功能-但是...当然,默认情况下应将其关闭(因为它无用99%时间),或至少易于配置为“关闭”设置?

I can't find anything useful in the documentation. 我找不到任何有用的文档。 Thanks. 谢谢。

There's an easy way to disable autocomplete, autocorrect, and autocapitalise on mobile devices. 有一种简单的方法可以在移动设备上禁用自动完成,自动更正和自动大写。 It comes in the form of 3 attributes that can be used on input fields: 它以3个属性的形式出现,可以在输入字段上使用:

<input type="text" autocorrect="off" />
<input type="text" autocomplete="off" />
<input type="text" autocapitalize="off" />

You can also disable spell-checking: 您还可以禁用拼写检查:

<input type="text" spellcheck="false" />

As far as I'm aware there is no native way to disable autocomplete built into reCAPTCHA. 据我所知,没有原生方法可以禁用reCAPTCHA中内置的自动完成功能。 As you say, I can't find anything in the docs or anywhere else. 如您所说,我在文档或其他任何地方都找不到任何内容。

As you say though, it would be fairly trivial to run a script to set this automagically: 就像您说的那样,运行脚本来自动设置此设置非常简单:
With jQuery: 使用jQuery:

$("input[type=text]").attr("autocomplete", "off");

Without jQuery (vanilla JS): 没有jQuery(香草JS):

document.querySelectorAll("input[type=text]").setAttribute("autocomplete", "off");

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

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