4 Replies Latest reply on Oct 26, 2011 5:22 AM by RMP-MD

    Action on Opening a data (XFDF) file in Form Filler

    RMP-MD

      I am trying to find out if there is a way in which to select a field, check its status and run a javascript based upon its data entry.  Problem is that we are passing a form from one person to another but just the data is being trasnsmitted.  Upon the second person, and so on, importing the data into a blank form, the selection of D or E (Deck or Engine), although selected, is NOT setting the form properly.  I need to reset the form based upon the selection of the D or E radio button.  Anyone have any ideas?  I have VERY little knowledge of Javascript but am learning.

       

      Thanks in advance.

       

      Richard

        • 1. Re: Action on Opening a data (XFDF) file in Form Filler
          George_Johnson MVP & Adobe Community Professional

          You need to explain what happens when a user selects D or E. Is this done with a radio button group, check boxes, a list box, combo box, or text field? Is a script triggered when the selection is manually made? Without knowing more details of how the form is set up, it's impossible to make suggestions.

          • 2. Re: Action on Opening a data (XFDF) file in Form Filler
            RMP-MD Level 1

            George,

             

             

            THANK YOU for the response.  It is a RADIO button and it fills in a Text Box

            with either D or E dependent upon the selection.  My problem is that when

            one user fills in the data and transmit the data (NOT FORM) in XFDF format,

            upon opening the file the D or E in the Text Box does not show BUT the

            proper radio button shows as if it has been selected.  IF PROPERLY SELECTED

            the background border changes from a white background to a light green (D)

            or light red (E) color and a box pops up as a title stating DECK QUESTION

            AUTHOR or ENGINE QUESTION AUTHOR.

             

             

             

            I need to find a way that when the file is open the D radio button which is

            selected is RESELECTED so that all colors and text, etc. are properly set.

             

             

             

            My first time ever doing this sort of thing and Javascript is copied from

            other sources on the Internet.

             

             

             

            Richard

            • 3. Re: Action on Opening a data (XFDF) file in Form Filler
              George_Johnson MVP & Adobe Community Professional

              Sorry, I missed the fact that you're using a radio button group.

               

              The root of the problem is there is no standard event that gets triggered for a radio button or check box when the field value is changed by importing form data or programmatically. What's really needed is Validate event for radio buttons and check boxes, which is something I've long wanted exposed. It turns out that radio buttons and check boxes can have validate scripts, but there is no UI in Acrobat for creating them. You can use JavaScript to set them up, however, using the field.setAction method. The script in the validate event would replace what you probably currently have in the Mouse Up event of the radio buttons, though it would have to be modified to work correctly as a validate script. You can also then edit the script using "Advanced > Document Processing > Edit All JavaScripts".

               

              The alternative is to make the field that displays D or E (or a different hidden field) a calculated field and place the code that makes the relevant changes in a custom calculate script for the field. The script can be set up to execute the code only when it is triggered by the radio button value change. In this case, the code that makes the changes will get triggered whenever the radio button value changes, whether it's due to a user making a manual selection, by importing form data, or programmatically.

               

              I realize this may be a bit confusing for a beginner, so post again if you'd like more help and include the code you're currently using.

              • 4. Re: Action on Opening a data (XFDF) file in Form Filler
                RMP-MD Level 1

                George,

                 

                I am willing to send you the form but do NOT want to post it on the forum.  if you want to communicate with me directly then email me a rm.plant@verizon.net.  Thank you.


                What you are stating above is over my head as I am new to Form Filler and especailly Javascript.

                 

                Richard