If you have a very long multi page form, you might choose to force the browser scroll position back to the top of the form on page change. You may do so using the following JavaScript snippet:
jQuery(function ($) { acf.addAction('af/form/page_changed', function (page, previousPage, form) { const formId = '#' + form.key; $('html, body').animate({ scrollTop: $(formId).offset().top }, 'slow'); }); });
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