Disable Submission when Pressing Enter for Gravity Forms

June 26, 2015: Added support for multi-page form navigation. Thanks @UaMV!

June 23, 2015: Updated to also allow enter on submit buttons. Thanks @UaMV!

I was asked an interesting question on Twitter the other day.

It had not occurred to me that some users would attempt to progress through the forms with the “Enter” key rather than tabbing. I think this is one of those cases where it’s hard to remember how new users interact with forms since we’ve been using them so long.

Disabling submission on enter could be quite frustrating for power users so use this with discretion. If you’re form is targeted towards non-technical users, I think you’ll be safe.

This snippet will only apply to forms created by Gravity Forms. If you’d like to enable this for any type of form, just remove this bit from the snippet: '.gform_wrapper',.

Getting Started

  1. Install our Custom Javascript plugin.
  2. Click the “Download Code” button above to download the raw version of this snippet.
  3. Copy and paste the snippet into the editor of the Custom Javascript for Gravity Forms plugin.
  4. That’s it!

Applying to All Forms

If your theme has a method for including script blocks in the header or footer, you can copy this snippet there.

Otherwise, you’ll need to copy the snippet into an existing script file or create your own. Make sure to remove the

You might also like...

Download Snippet

Disable Submission when Pressing Enter for Gravity Forms

This field is for validation purposes and should be left unchanged.