0 Replies Latest reply on Sep 19, 2012 8:32 AM by Teresa 2016

    Auto fill with Drop-Down box selection

    Teresa 2016

      I create several forms that utilize a drop-down box.  When the selection is made, it auto fills data in the forms (address, city, state, etc.).  However, now I need to have two drop-down boxes.  One box with our corporate addresses and another with vendor addresses and other individual information.  \

       

      Here is the code that is used in the Format Category of the Drop-Down Box:

       

      if(event.willCommit)

      {

      if (event.value=="")

      this.resetForm(["ComCompany","ComAddress","ComCity","ComState:,ComZip"]);

      else

      SetFieldValues(event.value);

       

      Here is the code that is used in the Document JavaScrips: (SetFieldValues)

       

      var DeptData={Company1: {company:"Company ABC", address:"123 Main St", city:"Las Vegas", state:"NV", zip"12345"},

      };

       

      function SetFieldValues(cDeptName)

      {

      this.getField(ComCompany).value=

      DeptData[cDeptName].company;

      this.getField(ComAddress).value=

      DeptData[cDeptName].address;

      }

       

      the code continues with more of the required data.  I code works well for one drop-down box.  How can I change this to incorporate 2 drop-down boxes?  I tried changing the Com in both the drop-down code and the Document Java Script to Vendor. The only thing that changed was only allowing me to change on drop-down box and not the other. 

       

      The vendor code will eventually contain information for hundreds of vendors.  Do you know of a way to incorporate both drop-downs or any other suggestions on how this can be accomplished?

       

      I am using Adobe Professional 9