Prevent Enter key from submitting Phoenix form

Thanks! For those that want to know you can just add this line as an option to Phoenix’s form_for :

<%= f = form_for @changeset, "#",
  id: "survey-form",
  phx_target: @myself,
  phx_change: "validate",
  phx_submit: "save",
  onkeydown: "return event.key != 'Enter';"%>  # add this line

This will prevent the enter key from submitting the form.