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
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Javascript help for pagecount

cwilliams2013
Level 2
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
Srini_Dhulipall
Level 10
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

cwilliams2013
Level 2
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