cancel
Showing results for 
Search instead for 
Did you mean: 

How to: display a field ONLY if there is a next page? JavaScript...

Former Member
0 Kudos

I need to print a text if there is a next page (like: "Continued on next page...").

I am trying to use the following JavaScript code:

if (xfa.layout.pagecount()==xfa.layout.page(this)) this.presence = "invisible";

The text gets printed on all pages, regardless of the number of pages.

If instead of that code I write:

this.presence = "invisible";

then it works. The field is hidden.

Why doesn't it work with the condition?

I am writing the code in the initialise event. Could that be the reason?

I have changed the form to Interactive XML.

It is my first JavaScript code in the Adobe form.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Nevermind... Found the solution myself:

data.MasterPages.Page1.Suplltext.continueNextPage::ready:layout - (JavaScript, client)
var v1 = xfa.layout.page(this);
var v2 = xfa.layout.pageCount();
if (v1 == v2) this.presence = "invisible";