How to show current page number in formcalc? | Community
Skip to main content
Level 2
March 21, 2011
Solved

How to show current page number in formcalc?

  • March 21, 2011
  • 2 replies
  • 12266 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by radzmar

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()

2 replies

radzmar
radzmarAccepted solution
Level 10
March 21, 2011

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()

lewis4242Author
Level 2
March 21, 2011

Perfect, thanks Radzmar!