Expand my Community achievements bar.

SOLVED

How Can I Increment a Counter on a Master Page?

Avatar

Level 2

I am working on a very complex form and have hit the proverbial wall. I have uploaded the file to the URL below and am seeking assistance in finalizing the form.

Here is the URL for the file.   https://workspaces.acrobat.com/?d=66B5k8981-WUNHJB1epZXg

There are three challenges that remain.  When I click on the "Click to Add Service Location" button on the bottom of page 2:

  1. I need to add an instance of "Service_Location_Page" on the following page.  Currently, it is adding it prior to the page I just completed.
  2. I need the value of "Service_Address_Type" on page 2 to change from the default value of "Primary" to "Secondary" on the new instance of "Service_Location_Page" and all subsequent instances.
  3. I need the "Service_Locaton" counter at the top of page 2 to increment by +1 for each new instance of "Service_Location_Page".

Any suggestions for refinements will be greatly appreciated.

Anokie1

1 Accepted Solution

Avatar

Correct answer by
Level 10

The link is not accessible.

Anyway, did you put the script into the indexChange event of Service_Location_Page and did you select FormCalc as language in the script editor?

View solution in original post

4 Replies

Avatar

Level 10

Hi,

I don't see a problem with the first point in your request.

For the second and third on you only need to add one script to the indexChange event of "Service_Location_Page".

Provider_Data_Intake_Form.Service_Location_Page::indexChange - (FormCalc, client)

if ($.index > 0) then

          Service_Locations.Service_Location.Service_Location_Header.Service_Address_Type = "Secondary"

else

          Service_Locations.Service_Location.Service_Location_Header.Service_Address_Type = "Primary"

endif

Service_Locations.Service_Location.Service_Location_Header.Service_Location = $.index + 1

Avatar

Level 2

radzmar,

I inserted your script into my document, but still cannot get it to work.  I also tried changing the ($.index > 0) to ($.index > 1) but that did not help. 

I have uploaded the new file to

https://workspaces.acrobat.com/?d=*vT-*LNHABGjkGJaP4eBHA

Please let me know what I need to do to correct.

Thanx.

anokie1

Avatar

Correct answer by
Level 10

The link is not accessible.

Anyway, did you put the script into the indexChange event of Service_Location_Page and did you select FormCalc as language in the script editor?

Avatar

Level 2

Thank you so-o-o-o much !!!  It works like a champ!