Coding Javascript/XML in PDF Forms

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • BlueChrome
    New Member
    • Apr 2008
    • 3

    Coding Javascript/XML in PDF Forms

    I am doing some basic sums in PDF Forms using Javascript and XML. The form is 4 pages long, and I can't get the sum fields on page 4 to reference cells on page 1. Here is one of my sum scripts:

    <calculate>
    <script contentType="ap plication/x-javascript">thi s.rawValue = II_TOTAL_REV_c. rawValue + II_6_c.rawValue + II_7_c.rawValue + II_8_c.rawValue + II_9_c.rawValue - II_10_c.rawValu e;</script>
    </calculate>

    The sum field continues to read "0.00" even when data is entered into the reference cells
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    I see you found the "Post a Question" link ;)

    Can you access the values on the second page?

    Comment

    • BlueChrome
      New Member
      • Apr 2008
      • 3

      #3
      No. I actually need to access fields on the first page from the second, and fields from the first three pages on the last. I noticed when I set the tab order that it reset to 1 every time I clicked on the next page, and I thought maybe it just does that, but now I'm wondering if I'm set up where each page is a separate section or something. I even tried referencing the page in the script (ie.
      Code:
      page2.field1.rawValue
      ) - to no avail.

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        Since the JavaScript in Adobe Acrobat is different from the ones used in web pages, I can't help much more than point you to the Developer Center for Acrobat. Good luck!

        Comment

        • BlueChrome
          New Member
          • Apr 2008
          • 3

          #5
          Interesting, thanks. I was studying one of their conversion manuals and noticed that they referenced subforms a lot. I looked into my document to see if it had any subforms and noticed it had subforms like P1, P3, etc. So I thought "Could P1=Page 1?" Yep. When I rewrote the script to reference P1.Field1.rawVa lue, it worked.

          Praise the Lord, Hallelujah.

          Comment

          • acoder
            Recognized Expert MVP
            • Nov 2006
            • 16032

            #6
            Well done. Glad you got it working and thanks for posting.

            Comment

            Working...