gpt4 book ai didi

html - 如何阻止 Chrome 自动完成文本区域?

转载 作者:搜寻专家 更新时间:2023-10-31 22:18:06 24 4
gpt4 key购买 nike

我正在处理 Chrome 想要自动填充用户地址的联系表单的一部分中的文本区域。因此,许多联系请求是由用户在评论字段中提交他们的地址。除了可能被利用的明显的潜在安全问题外,我担心的是,从用户的角度来看,我们提供的联系表没有用于键入消息的区域。从支持的角度来看,我们不得不要求用户向我们发送另一条消息,说明他们的实际问题。

HTML:

 <textarea id="element_10" class="validate[required] floatlabel js-auto-size multiple-lines" name="element_10" placeholder="Message*" rows="10" cols="60" required autocomplete="off"></textarea>

最佳答案

回答我自己的问题,因为我没有在 Stack 或任何 Chrome 浏览器文档中找到答案。

In some cases, the browser will keep suggesting autocompletion values even if the autocomplete attribute is set to off. This unexpected behavior can be quite puzzling for developers. The trick to really forcing the no-autocompletion is to assign a random string to the attribute, for example:

autocomplete="nope"

Since this random value is not a valid one, the browser will give up.

https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion

关于html - 如何阻止 Chrome 自动完成文本区域?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43217431/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com