Highlighted

script called as many times as masterpage is used

Avatar

Guest

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

Highlighted

_SekharN_

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

}