Prevent Enter key from submitting a form unless user is on Submit button

By: Vicki Greer | Asked: 08/09/2023
ForumsCategory: How-toPrevent Enter key from submitting a form unless user is on Submit button
Vicki Greer asked 1 year ago
Hi, I have a form with lots of fields. The end user is asking if it is possible to have the Enter key NOT submit the form. They want to use the Enter key to move from field to field, like the Tab key. They want the user to have to click on the Submit button to submit the form. I think they'd also need to allow the Enter key to submit the form if the user was on the Submit button and pressed Enter. Is there an easy way to make this happen? Thanks, Vicki G.
1 Answers
Victor Font answered 1 year ago
Here's an old solution to your problem. You have to create custom jQuery. https://stackoverflow.com/questions/1009808/enter-key-press-behaves-like-a-tab-in-javascript

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right