Expand my Community achievements bar.

SOLVED

Go to pages in a form

Avatar

Level 7

I have a multi-page form. I would like to provide buttons that let the user move to the next page

, previous page and first and last pages.

In a previous posting on the Forum, I found this piece of script xfa.host.pageDown(); to let the user display the next page. And there's a comparable piece of script to display the previous page.

What script do I use to move to the first page of the form or the last page of the form?

Thanks,

MDawn

1 Accepted Solution

Avatar

Correct answer by
Level 10

Unless anyone has any other way, you can use the setFocus method to a field on the page you want to move.

     xfa.host.setFocus

If you want to move to Last page, use xfa.host.setFocus("LastPage.TextField1");

If you want to move to First page, use xfa.host.setFocus("FirstPage.TextField1");

You already have the pageDown and pageUp methods to move between next and previous pages.

xfa.host.pageDown

xfa.host.pageUp

Thanks

Srini

View solution in original post

4 Replies

Avatar

Correct answer by
Level 10

Unless anyone has any other way, you can use the setFocus method to a field on the page you want to move.

     xfa.host.setFocus

If you want to move to Last page, use xfa.host.setFocus("LastPage.TextField1");

If you want to move to First page, use xfa.host.setFocus("FirstPage.TextField1");

You already have the pageDown and pageUp methods to move between next and previous pages.

xfa.host.pageDown

xfa.host.pageUp

Thanks

Srini

Avatar

Level 7

Thanks, Srini. Do I use the actual words LastPage? Or do I use the name of the page object from the Hierarchy panel?

Thanks,

Margaret Dawn

Supervisor - Documentation

W: 630-850-1065

Avatar

Level 10

You need to use the actual page name from the heirarchy.

I only put the LastPage as a sample code..

Thanks

Srini

Avatar

Level 7

Just making sure. Thanks.

Margaret Dawn

Supervisor - Documentation

W: 630-850-1065