I have a form with "Previous" and "Next" page buttons on a second master page. I was wondering if it were possible to script the Next Page button so that it detects what page it is on and if it is the last page of the form, to hide it. The bottom of the form has buttons for Save, Print, and Email, so I don't want any buttons appearing below that.
Can this be done?
I thought about just creating a third master page with only the Previous Page button on it, but then though that maybe I could save a few bytes and make the Next Page button more functional.
I appreciate your help!
Thanks
Solved! Go to Solution.
This is quite easy to accomplish:
This script comes into the click event …
// Goto next page
xfa.host.currentPage = xfa.layout.absPage(this) + 1;
… and this into the layout ready event.
// Hide the button on the last page
this.presence = (xfa.layout.absPage(this) + 1) < xfa.layout.absPageCount() ? "visible" : "hidden";
Views
Replies
Total Likes
This is quite easy to accomplish:
This script comes into the click event …
// Goto next page
xfa.host.currentPage = xfa.layout.absPage(this) + 1;
… and this into the layout ready event.
// Hide the button on the last page
this.presence = (xfa.layout.absPage(this) + 1) < xfa.layout.absPageCount() ? "visible" : "hidden";
Views
Replies
Total Likes
Oh, that is cool!
Thank you!
Views
Replies
Total Likes
radzmar, thanks again for this code snippet. Definitely came in handy.
How can I modify it for a Reset button? I have a form with a Reset button on the Master page but I only want the button to show on the first page.
I appreciate your help.
Views
Replies
Total Likes
To show the button only on the fist age use this script:
// Hide the button on every page except the first
this.presence = (xfa.layout.absPage(this) + 1) === 1 ? "visible" : "hidden";
Or alternatively:
// Hide the button on every page except the first
this.presence = xfa.layout.absPage(this) === 0 ? "visible" : "hidden";
Genius! Thank you so much!
Views
Replies
Total Likes