13-02-2009
Steve_L_Walker
Steve_L_Walker
13-02-2009
Niall_O_Donovan
Niall_O_Donovan
14-02-2009
17-02-2009
DrDave6
DrDave6
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.
Niall_O_Donovan
Niall_O_Donovan
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.
DrDave6
DrDave6
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?"
Niall_O_Donovan
Niall_O_Donovan
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
DrDave6
DrDave6
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.
jashachik
jashachik
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?