• I have noticed that the default behaviour for the enter key is somewhat undesireable: When pressing the enter key in a multi-page form I immediately receive the validation errors for all fields in the form.

    Instead the form should continue to the next page.
    I have fixed this locally with the following js snippet:

    
    jQuery(document).ready(function() {
      acf.addAction('af/form/setup', function( form ) {
        form.$el.keypress(function(event) {
          var keycode = event.keyCode || event.which;
          if ( keycode !== 13 ) return;
          event.preventDefault();
          af.pages.nextPage( form );
        });
      });
    });
    

    Downside of this approach:
    This breaks submitting the form on the last page with the enter key:
    I couldn’t figure out how to get an updated form var to check the current page, it would be vary useful if there was a function to get the form var with updates properties in return.

    • This topic was modified 4 years, 10 months ago by fabeyg.
Viewing 1 replies (of 1 total)
  • Plugin Author fabianlindfors

    (@fabianlindfors)

    Hi!

    Just wanted to say that I’ve taken note of this and will see if I can fix it for a future version. Thanks for taking the time to create a ticket!

Viewing 1 replies (of 1 total)
  • The topic ‘Multi-Page Form: Enter key’ is closed to new replies.