By default, hitting the enter key submits a form. If you need to modify this behaviour when using a multistage form, you may use the following snippet as a boilerplate.
jQuery(function($) { // Add your form key here const formKey = 'form_62d743d9eca45'; $('.af-form input').on('keydown', function(e) { if (e.originalEvent.key === 'Enter') { e.preventDefault(); // Preventing the default action if (af.forms[formKey] && af.forms[formKey].$next_button) { af.forms[formKey].$next_button.click(); } return false; } }); });
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article