Expand my Community achievements bar.

SOLVED

How to show current page number in formcalc?

Avatar

Level 2

I have a client who won't allow JavaScript in their forms for security reasons.  I'm trying to convert the JS I've used to work with FormCalc instead, but I don't have much experience with FC and I'm stuck at the first hurdle.

I want to display the current and total pages in the master page and I've changed the generated code to use FormCalc and changed to use the dollar reference, but the form doesn't render the current page number.

Here's the code

return.#pageSet[0].Restricted.CurrentPageNumber::ready:layout - (FormCalc, client)

//Doesn't work, even though it's copied from the reference material

this.rawValue = xfa.layout.page($)

// also tried

$ = xfa.layout.page($)


return.#pageSet[0].Restricted.NumberofPages::ready:layout - (FormCalc, client)

//Works

this.rawValue = xfa.layout.pageCount()

Any and all help would be really appreciated

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

to get the current page, you can use the index of your master page ("Restricted").

$ = $.parent.index +1

and for the total pages use

$ = $layout.pageCount()

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

Hi,

to get the current page, you can use the index of your master page ("Restricted").

$ = $.parent.index +1

and for the total pages use

$ = $layout.pageCount()