Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

script called as many times as masterpage is used

Avatar

04-06-2008

Hello,



When people build a form with n pages, and a global script within, there's a strange behaviour with the script.



When this form loads, this global script is called as many times as the total number of pages in my form, like if it was instanciating it again and again



How avoid it ?



Thanks for your help !

Replies

Avatar

Avatar
Level 5
_SekharN_
Level 5

Likes

0 likes

Total Posts

246 posts

Correct Reply

0 solutions
View profile

Avatar
Level 5
_SekharN_
Level 5

Likes

0 likes

Total Posts

246 posts

Correct Reply

0 solutions
View profile
_SekharN_
Level 5

04-06-2008

Here some sample JavaScript code that might help you resolve the issue.



var curPageNum = xfa.host.currentPage + 1; // this is index

// based starts with 0



if (curPageNum == 1) {

// run your current script here then it will run only one

//time on page 1

}