Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session

Javascript help for pagecount

Avatar

Level 2

H All,

I am trying to write a javascript to show the address if the page count on the form is less than 10 pages . the form grows dynamically based on the .xml data

my address field has javascript

xfa.resolveNode("Correspondance.#subform.Client_Addrp1").rawValue = xfa.resolveNode("Correspondance.#subform[4].Client_addr_Name").rawValue + "\n" +  xfa.resolveNode("Correspondance.#subform[4].Client_addr1").rawValue + "\n" + xfa.resolveNode("Correspondance.#subform[4].Client_addr2").rawValue + "\n" + xfa.resolveNode("Correspondance.#subform[4].Client_addr_City").rawValue + " " + xfa.resolveNode("Correspondance.#subform[4].Client_addr_State").rawValue + " " + xfa.resolveNode("Correspondance.#subform[4].Client_addr_zip").rawValue;

but i also want to show the address on the page if the page count is less than 10 pages, can somebody help me to incorporate the pagecount logic on the address field.

Thanks in advance.

Cwilliam



3 Replies

Avatar

Level 10

 

xfa.layout.pageCount() can give you the page count in the form..

//Check if the page count is less than 10

if(xfa.layout.pageCount()<10){

     //You can write code to display the Address.

}

Let me know if this helps..

Thanks

Srini

Avatar

Level 2

Thanks srini, it worked ..thank u very much..

also if possible can you please tell me the difference between

xfa.host.numpages and xfa.layout.pageCount()

i have tried if(xfa.host.numpages <10)

{ }, it did not work though..

Thanks again

cwilliam