2 Replies Latest reply on Aug 2, 2016 12:57 AM by pdfUser1

    Need help. Trigger drop downs and associated text fields.

    pdfUser1 Level 1

      I have several drop downs and text fields.  Select a name from Dropdown1 and the value goes into Txt1 text field (that's the easy part). The name from Dropdown1 shows in all the other drop downs but the values of each drop down goes into the associated text field. Dropdown2 value goes into Txt2 text field. Dropdown3 value goes into Txt3 text field, and so on. All the drop downs have the same names in the list of names but different export values. How would I trigger each drop down to automatically put each of the drop down's values in each of the text fields? I'm too inexperienced in javascripting to be able to this on my own. Believe me I've tried.

       

      What I'd like to do is, when I select a name from Dropdown1, then Dropdown2, Dropdown3, Dropdown4, Dropdown5 would show that name but would trigger the export value (of that particular drop down) to go into the associated text field.

       

      I need help getting this done so if you can please provide a bit of javascript, to get me started I can then apply it to the rest of the fields in my form, that would be great. I don't need suggestions to other options simply because this form is rather large and I can't start creating it all over again. This is what it is and what I have to use. So, can you help me get this done? Thank you.

       

      Using Acrobat X pro.

        • 1. Re: Need help. Trigger drop downs and associated text fields.
          gkaiseril MVP & Adobe Community Professional

          Why not fill all the other text fields from the first drop down?

           

          Reduces the number of fields, user input, refuces chance of errors in your code.

           

          There is an example in the tutorials in the PDF Library.

          • 2. Re: Need help. Trigger drop downs and associated text fields.
            pdfUser1 Level 1

            That's not what I'm looking to do. I want to keep it as it is, too much to change now. And, besides if I can't get the script I'm looking for, then the form is done. If I can get the help I need then that also will be great.

             

            I have this script so far, it works to put the name of the first drop down into the other drop downs but doesn't trigger them to populate the text field with the export values of each drop down. That's the part I need help with. How would I get the drop downs to trigger without having to click on it? This is the script I use in Dropdown1:

             

            if(event.willCommit)

              this.getField("NameFirst").value = event.value; ///the person's SSN

             

            if(event.willCommit)

              this.getField("workClass1").value = event.value; ///the person's work classification

             

            if(event.willCommit)

              this.getField("payRate1").value = event.value; ///the person's rate of pay

             

            and so on...

             

            If you can help please do. I'd really like to get this done. It probably isn't too complicated but I just cannot find the solution.