How do I turn off autocomplete for the inputs in a form in Elixir/Phoenix?

Viewed 348

For example, how would this need to change to prevent autocomplete in the name field?

<%= form_for @changeset, @action, fn f -> %>
  <%= label f, :name %>
  <%= text_input f, :name %>
  <%= error_tag f, :name %>
<% end %>
1 Answers

You can just set autocomplete: "off" for both the form and text_input.

<%= form_for @changeset, @action, [autocomplete: "off"], fn f -> %>
  <%= label f, :name %>
  <%= text_input f, :name, autocomplete: "off" %>
  <%= error_tag f, :name %>
<% end %>
Related