When moving to the next page of a form I want the screen to be scrolled up

In case you have a rather large multi-page form and you want to automatically scroll the window to the top of the form upon proceeding to the second, third or to any other page, follow the guide below.

  • Head over to CSS and Javascript section
  • Insert the following snippet in the Javascript designated area
  • <script>
    
    RSFormPro.Pages.show = function(thePage) {
      RSFormProUtils.removeClass(thePage, 'formHidden');
        var pageNumber = parseInt(thePage.id.split("_").pop());
        if(pageNumber > 0 ){
            window.scrollTo(0, findPos(document.getElementById('userForm')));
        }
    }
    
    function findPos(obj) {
      var curtop = 0;
       if (obj.offsetParent) {
        do {
            curtop += obj.offsetTop;
           } while (obj = obj.offsetParent);
       return [curtop];
       }
    }
    
    </script>
  • Save your form

If you followed the steps above, when you will click the NEXT or PREVIOUS buttons (from the Pagebreak form field), your window will be scrolled to the top of the form


72 persons found this article helpful.


Was this article helpful?

Yes No
Sorry about that