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
BedrockMission!

Learn More

View all

Sign in to view all badges

Page Navigation

Avatar

13-02-2009

I am trying to insert page navigation buttons that will go to specific pages in my form. I thought this would as easy as inserting hyperlinks, but this doesn't seem to be an option in ALC.



I have an eight page form and want them to be able to jump to various pages. Can someone please advise me how to do this?

Replies

Avatar

Avatar
Validate 1
Level 9
Steve_L_Walker
Level 9

Likes

197 likes

Total Posts

1,435 posts

Correct Reply

212 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 25
View profile

Avatar
Validate 1
Level 9
Steve_L_Walker
Level 9

Likes

197 likes

Total Posts

1,435 posts

Correct Reply

212 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 25
View profile
Steve_L_Walker
Level 9

13-02-2009

Cristy,



Consider the use of bookmarks.



For navigation buttons you are limited to serially paging through the form using xfa.host.pageUp() and xfa.host.pageDown() on a button click event.



Steve

Avatar

Avatar
Validate 1
Level 10
Niall_O_Donovan
Level 10

Likes

646 likes

Total Posts

4,352 posts

Correct Reply

786 solutions
Top badges earned
Validate 1
Boost 500
Boost 50
Boost 5
Boost 3
View profile

Avatar
Validate 1
Level 10
Niall_O_Donovan
Level 10

Likes

646 likes

Total Posts

4,352 posts

Correct Reply

786 solutions
Top badges earned
Validate 1
Boost 500
Boost 50
Boost 5
Boost 3
View profile
Niall_O_Donovan
Level 10

14-02-2009

Hi Cristy,



I have a button that jumps the user to the last page of a 10 page form. The following Javascript is in the click event:



xfa.host.currentPage = xfa.host.numPages - 1;



I presume that if you had something similar and changed the subtracted value you could have your navigation buttons.



Good luck,



Niall

Avatar

17-02-2009

Thank you! I adjusted the XML code and am now able to navigate at will.



Regards.

Avatar

Avatar
Validate 10
Level 1
DrDave6
Level 1

Likes

0 likes

Total Posts

55 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
View profile

Avatar
Validate 10
Level 1
DrDave6
Level 1

Likes

0 likes

Total Posts

55 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
View profile
DrDave6
Level 1

16-04-2009

I have put two buttons in my form ("Previous Page" and "Next Page").

For the "Next Page" button I want to say, if I'm on the last-page, goto page-1,   else xfa.host.pageDown().

For the "Previous Page" button I was to say, if I'm on the first-page, goto the last pge, else xfa.host.pageUp()

What does the java script look like for these two buttons? As you can see, I'm new at this! 🙂

Thank you for your help.

Avatar

Avatar
Validate 1
Level 10
Niall_O_Donovan
Level 10

Likes

646 likes

Total Posts

4,352 posts

Correct Reply

786 solutions
Top badges earned
Validate 1
Boost 500
Boost 50
Boost 5
Boost 3
View profile

Avatar
Validate 1
Level 10
Niall_O_Donovan
Level 10

Likes

646 likes

Total Posts

4,352 posts

Correct Reply

786 solutions
Top badges earned
Validate 1
Boost 500
Boost 50
Boost 5
Boost 3
View profile
Niall_O_Donovan
Level 10

16-04-2009

Hi,

You can script this, but I wonder is it a good thing for a user to click page up on page 1 and end up at the last page. Similarly for the last page. It might confuse.

Anyway, page up on page 1 could look like:


if (xfa.host.currentPage == 0)

{

     xfa.host.currentPage = xfa.host.numPages - 1;

}

else

{
    xfa.host.pageUp()

}

The page down on the last page could look like this:

if (xfa.host.currentPage == xfa.host.numPages - 1)

{

     xfa.host.currentPage = 0;

}

else

{
     xfa.host.pageDown()

}

I will be honest, I think that I would delete the "Page Up" button on page 1 and the "Page Down" button off  the last page...

N.

Avatar

Avatar
Validate 10
Level 1
DrDave6
Level 1

Likes

0 likes

Total Posts

55 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
View profile

Avatar
Validate 10
Level 1
DrDave6
Level 1

Likes

0 likes

Total Posts

55 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
View profile
DrDave6
Level 1

16-04-2009

Thank you for your insight here, I see what you mean.

Would I, for example on the "Next Page" button, say "if on the last page, then make the button invisible?"

Avatar

Avatar
Validate 1
Level 10
Niall_O_Donovan
Level 10

Likes

646 likes

Total Posts

4,352 posts

Correct Reply

786 solutions
Top badges earned
Validate 1
Boost 500
Boost 50
Boost 5
Boost 3
View profile

Avatar
Validate 1
Level 10
Niall_O_Donovan
Level 10

Likes

646 likes

Total Posts

4,352 posts

Correct Reply

786 solutions
Top badges earned
Validate 1
Boost 500
Boost 50
Boost 5
Boost 3
View profile
Niall_O_Donovan
Level 10

16-04-2009

Hi,

If the buttons on are the individual pages, then I would just delete the appropriate ones on the first and last pages.

If the buttons are on the master page, then I don't think that you can change the presence of the buttons based on the page number the user is currently viewing.

You can change what the button does, for example:

if (xfa.host.currentPage == xfa.host.numPages - 1)
{
    app.alert("You are already on the last page");
}
else
{
     xfa.host.pageDown();
}

Hope that helps,

Niall

Avatar

Avatar
Validate 10
Level 1
DrDave6
Level 1

Likes

0 likes

Total Posts

55 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
View profile

Avatar
Validate 10
Level 1
DrDave6
Level 1

Likes

0 likes

Total Posts

55 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
View profile
DrDave6
Level 1

16-04-2009

My buttons are on the Master Page and you are correct, you cannot set the presence if that is the case as I tried this.

Thanks for your help, the matter is resolved now.

Avatar

Avatar
Level 1
jashachik
Level 1

Likes

0 likes

Total Posts

20 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
jashachik
Level 1

Likes

0 likes

Total Posts

20 posts

Correct Reply

0 solutions
View profile
jashachik
Level 1

21-11-2013

I am successfully using xfa.host.currentPage = 2; for navigation on a PDF but for HTML it does not work, can you provide the logic to make this work just like the PDF?