[英]how to stop autocomplete from working on a specific form field
this is my form field:这是我的表单字段:
.country.booking-field = passenger.select :country,
Country.all.pluck(:name),
{prompt: t('booking.country')},
autocomplete: 'false',
class: "country tt-input select-beast"
I tried to stop the autocomplete from completing the country field, but the field is still autocompleted.我试图阻止自动完成完成国家/地区字段,但该字段仍然是自动完成的。 what am I doing wrong here?
我在这里做错了什么?
更新
html: { autocomplete: 'off' }
This is a known error, I am not sure why it happens but it can be a really annoying thing to work out, using autocomplete: 'false'
or autocomplete: 'off'
doesn't work.这是一个已知错误,我不确定它为什么会发生,但是使用
autocomplete: 'false'
或autocomplete: 'off'
来解决它可能是一件非常烦人的事情。
The only known method is to use autocomplete: 'new-password'
唯一已知的方法是使用
autocomplete: 'new-password'
I know that this works for plain HTML, it might not work for whatever language you're using, but it is definitely worth a try!我知道这适用于纯 HTML,它可能不适用于您使用的任何语言,但绝对值得一试!
Cheers.干杯。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.