Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Navigation/pagination problem-going to bottom of pages, not top

Avatar

Level 4

Hello everyone,

This is a pretty basic question. My form has navigation buttons that go to the next page and hide the previous page(s).

For a 2 page form here is the script for the click event for the Navi button on page 1:

xfa.host.currentPage = 2;

form1.page2.presence = "visible";

form1.page1.presence = "hidden";

Page2 is initially hidden when the form loads.  Now, when I set the Pagination "place" for page2 as Top of Next Page, an empty page appears before page2.  I fixed this problem by setting the pagination place to Following Previous.  This gets rid of that blank page but unfortunately makes the user start off at the bottom of the page and scroll up.   Any idea about what I'm doing wrong here?

Thanks!

0 Replies

Avatar

Level 10

Hi,

How about placing the presence script in the mouseUp event, so that this fires first and the form is layed out before the click event fires with the currentPage script.

Niall

Avatar

Level 4

Using the currentPage script still doesn't have the user start at the top of the page. 

But having different parts firing at different times gave me the idea for a work-around.  Since I have Navigation OK buttons at the top of the pages, instead of using the .currentPage script I used the .setFocus script which sets the focus to the OK button.  The mouseUp event changes the presence of the pages and the click event sets the focus.  This in effect has the user starting at the top of the page. 

Having the click event set the presence of the the Ok button to invisible works also.  As long as the Ok button is visible when the MouseUp event fires, there are no problems.  But no need to over-engineer it in this instance. 

Thanks for the helpful hint Niall.

P.S if anyone knows a more "correct" way of doing this, I'd love to hear it.