• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: "Next" page button; Scroll to Top/Form Issue

"Next" page button; Scroll to Top/Form Issue 9 years 9 months ago #31766

  • Toad78
  • Toad78's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 27
So I've followed this example:
<script type="text/javascript">
function rsfp_changePageScroll(param1, param2, param3, param4)
{
rsfp_changePage(param1, param2, param3, param4);
scroll(0,0);
}
</script>
 
$formLayout = str_replace('rsfp_changePage','rsfp_changePageScroll',$formLayout);

When wanted the user to be located at the top of the form once they click the 'Next' page button. Unfortunately, there is a downside to this in my situation: When the user first visits the page, they are scrolled to the top of the page, as they should. But then if a user clicks the 'Next' page button, they are also scrolled to the top of the page, not to the top of the form.

So then I tried this code:

<script>
 
function rsfp_showPage(thePage) {
  RSFormProUtils.removeClass(thePage, 'formHidden');
  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>

This wasn't any better as when the user visits the first page, they are scrolled to the form immediately and not to the top of the page. But this code works fine if the user needs to be at the top of the form when they click the 'Next' page button.

So how can I get this to function properly when the user first visits the page, they should be at the top of the page and then when they click the 'Next' page button, they are scrolled to the top of the FORM on the next page?

BTW, I have FOUR pages to this form, if that makes any difference to the way the code needs to be implemented.
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!