Skip to main content
Inspiring
November 10, 2020
Answered

Please help with custom javascript button: New Form page from template needs to redirect to new page

  • November 10, 2020
  • 1 reply
  • 529 views

This script works almost perfect:

 

var pageCount = 0;
var pagePos = 0;
pageCount = this.numPages;
pagePos = pageCount+1;
var b = getTemplate("EVC");
b.spawn({nPage: pagePos, bRename: true, bOverlay: false});

 

I have one issue with this. How to do get the page view to jump to the newly generated page when this same button is clicked? Currently the page view is staying on the same page and then I have to scroll to the next page, so I can't tell if the new page is generated unless I'm watching the page numbers change.

This topic has been closed for replies.
Correct answer George_Johnson

You could set the pageNum property to the newly generated page, which should be the same as pageCount. So you could add the following line of code to the end of your script:

 

pageNum = pageCount;

1 reply

George_JohnsonCorrect answer
Inspiring
November 10, 2020

You could set the pageNum property to the newly generated page, which should be the same as pageCount. So you could add the following line of code to the end of your script:

 

pageNum = pageCount;