Expand my Community achievements bar.

Applications for the 2024-2025 Adobe Experience Manager Champion Program are open!
SOLVED

Go to last page when doc:ready

Avatar

Level 6

I'm sure this is a simple script, but I'm looking for a way to have my form automatically open on the last page of the document once the form finish loading (doc:ready event).

Can someone please help?

Thanks

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

You can achive this using the currentPage property:

This JavaScript in the docReady event:

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

Note, you subtract 1 from the number of pages to get it into the zero-based system for page numbers. Eg, the first page is 0.

Hope that helps,

Niall

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

Hi,

You can achive this using the currentPage property:

This JavaScript in the docReady event:

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

Note, you subtract 1 from the number of pages to get it into the zero-based system for page numbers. Eg, the first page is 0.

Hope that helps,

Niall

Avatar

Level 6

Thanks Naill, that's what I needed.

I'm sure you answer these types of "simple" questions all day long, but thank you for taking the time to respond.

Your continued assistance is greatly appreciated.

Thanks.