5 Replies Latest reply on Aug 8, 2011 3:03 PM by try67

    Muti Select List Box and a few other questions?

    DanMun Level 1

      Muti Select List Box and a few other questions?

       

      I have 4 things I need to accomplish in a form.

       

      1. Is there a way to populate a list box from an excel or word file?

       

      1. I need to populate a text box from a multi select list box with sentences and each selection must be separated

       

      1. I need to create a button that commits the final selected items in the above text box to another text box in the form.

       

      1. I need a button that will print a selected page of the form.

       

      How many “sentences” can you put in a list box-if it is limited is there a way to expand it with code? 

       

      I know this is probably a lot to ask, but you never know.  I have accomplished transferring one selected item in a list box to a textbox, using this code:

      var targ1=getField("text1");

      if(!event.willCommit){

          targ1.value=event.change;

      }

       

      In the selection change-execute a script box.

       

      but that is not enough.

       

      Thanks So Much

       

       

        • 1. Re: Muti Select List Box and a few other questions?
          maxwyss Level 4

          > Is there a way to populate a list box from an excel or word file?

           

          This can be done. The exact way of implementation depends on the actual workflow and the circumstances. Therefore, it has to be specified further. But in any case, a way to accomplish this can be found.

           

           

          > I need to populate a text box from a multi select list box with sentences and each selection must be separated

           

          This can be done. The value of a multi-select listbox is an array, which has to be interpreted accordingly, and then you can assemble the string to be entered into the target field (for example by adding \r characters.

           

           

          > I need to create a button that commits the final selected items in the above text box to another text box in the form.

           

          This is definitely simple. The code for the MouseUp event of that button looks like this:

           

               this.getField("targetField").value = this.getField("sourceField").valueAsString ;

           

          And that should do it.

           

           

          > I need a button that will print a selected page of the form.

           

          This again should be straightforward, using the print() method. For all the possible arguments, have a closer look at the Acrobat JavaScript documentation.

           

           

          Hope this can help.

           

          Max Wyss.

           

          • 2. Re: Muti Select List Box and a few other questions?
            DanMun Level 1

            Thank you Max,

             

            Do you know of an resources that may assist me in accomplishing these tasks?

            • 3. Re: Muti Select List Box and a few other questions?
              maxwyss Level 4

              The most fundamental resource is the Acrobat JavaScript documentation (part of the documentation of the Acrobat X SDK, downloadable from the Adobe website).

               

              About the import form Excel, you might look around here in the forums and other leading forum sites for tips on how to handle Data Objects.

               

              That's about what comes to my mind for the case you want to "make" (if you are aiming for the "buy" option, feel free to contact me in private )

               

              Hope this can help.

               

              Max Wyss.

              • 4. Re: Muti Select List Box and a few other questions?
                DanMun Level 1

                Thank you for the answer.  It works great.  Can it me modiied to enter multiple seetions of the list box easily?

                Thanks

                • 5. Re: Muti Select List Box and a few other questions?
                  try67 MVP & Adobe Community Professional

                  This script, created by me, can be used to import data from an Excel file (if saved in the right format) to a combo- or list-box:

                  http://try67.blogspot.com/2009/11/acrobat-import-text-file-to-drop-down.html