Skip to main content
Level 2
March 21, 2011
Répondu

How to show current page number in formcalc?

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

Ce sujet a été fermé aux réponses.
Meilleure réponse par 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 commentaires

radzmar
radzmarRéponse
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()

lewis4242Auteur
Level 2
March 21, 2011

Perfect, thanks Radzmar!