cancel
Showing results for 
Search instead for 
Did you mean: 

How to Hide a field based on the page number!

Former Member
0 Kudos

Dear friends,

I am working on the adobe print form and I need one address to be printed only on the first page . I have a master page with several other fields which need to be printed on every page. But the remittance address needs to be printed only on first one.

I trying scripting

if ( xfa.layout.pageCount() ne 1 ) then

$.presence = "hidden"

endif

I also tried

if (PageCount ne "1" ) then

$.presence = "hidden"

endif

Here PageCount is the automatically generated field when Page number from library is used.

Any ideas?

Regards,

Nisha

Accepted Solutions (1)

Accepted Solutions (1)

nikhilkup
Active Participant
0 Kudos

Wrap the field which needs to be hidden in a subform.

In initialise

// hiding and showing the Protection sub form

if($record.PAGE_NO.DATA.FIELD == "" )

then

SUBFORMNAME.presence = "visible"

else

SUBFORMNAME.presence = "hidden"

endif

In change

// hiding and showing the Protection sub form

if($record. PAGE_NO.DATA.FIELD == "" )

then

SUBFORMNAME.presence = "hidden"

else

SUBFORMNAME.presence = "visible"

endif

Former Member
0 Kudos

Thank You Nikhil! It solved my problem.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

You can set a variable to some initial value like 1 . in script check if the value is 1 then display it . then after this change the value of this to 2 .

Whenever a new master page will be triggered ( 2nd time ) the value of this variable will be 2 and it wont print the address.

Former Member
0 Kudos

Hi,

In general, Master page content are displys all the pages, so we cant hide a particular field only, rather you can set the which field you want to print in first page.

This way you can achieve.

By

Parthi

Former Member
0 Kudos

Thank you, but how do I set that a particular field has to be displayed in first page only?

Former Member
0 Kudos

Are you working with multiple Master Pages and Subforms? You can set subforms to only occur once, on the first page, and from then on start generating a different subform starting from page 2 (use Content Areas).

Don't be afraid to play with Master Pages / Content Areas / Subforms, it's a bit archaic at first, but you can do amazingly powerful stuff with it.