How to prevent form submission on enter key

Hey,

I have a form element that has a submit workflow linked to the form element. Right now, when my users click enter the form submits as the enter key triggers the submit workflow. This is not the behaviour that I want. I only want the form to submit when the user clicks the submit button contained within the form.

Is there a WeWebby way to achieve this? I’ve tried accessing the ‘event’ but this is null when using a submit workflow. I don’t want to convert the workflow to an on click event as I want to keep the form validations.

What else could I try?

Probably create a variable buttonWasClicked that is boolean defaulting to false.

  • Set to true when clicking the button
  • Add conditional on your submit workflow if buttonWasClicked = true then perform your actions else do nothing
  • Reset buttonWasClicked