Is there a way to force Chrome or other browsers to not try and autocomplete certain fields on a form? I’d rather not tell clients they must do this globally in their browser, and it’s too easy to accidentally wipe out a lot of data on a form by Chrome overwriting with autofill.
Hi,
Starting from platform v6.10.2 you can use the HtmlAttributes
bean that allows setting DOM / CSS attributes programmatically. In order to disable Chrome’s autofill functionality for a certain field, you need to set
the autocomplete
attribute to off
, e.g.
@Inject
private HtmlAttributes htmlAttributes;
...
htmlAttributes.setDomAttribute(emailField, "autocomplete", "off");
Regards,
Gleb