Expand my Community achievements bar.

Two Questions: Dropdown Menus / Add Buttons

Avatar

Level 1

Alright, I have two questions regarding how to add information onto a form.  The form is a vendor profile I have for my projects.  The base for the form is created in Microsoft Word, from which I create a PDF and then place the proper fields I want, with all the formatting, in LiveCycle. I am not a programmer, and have little to no understanding of java script or anything I might need to understand.

Given that, I have a few questions:

1.  Drop Down Menus:  Each vendor may have more than one service I need to use.  I have two drop down menus, and I need the selection in the first drop down menue (Materials, Infrastructure, Communications, Human Resources) to determine the selections in the second drop down menu.  For example, should I select Materials, I need to see a drop down menu populated with Literature, Signs, Collateral, etc.  1)  Do I need to use some sort of programming code to do that, 2) Can I do that with a document created in Word, and the transitioned to a PDF, 3)  How do I insert hte code into the document to properly do that.

2.  Each vendor, again, may have more than one service.  Therefore, I'd like to know if it's possible to insert an "ADD" Button, so that each time I click it a new line of services is added.

4 Replies

Avatar

Level 6

Re. #1.  Yes you can do dependent drop lists with coding.  There are some good examples on line.

             WORD - when imported did it lose formatting?  I never have a perfect import with WORD but it can be done

             Code insert - find a sample and copy it.  Google will return samples for you

     #2.  YES -

send me a pm and I'll dig out a sample

Avatar

Level 1

Thanks, any particular search terms to use, and what do I look for?  Again, not being a programmer, I'm not entirely sure.  I've thought I found some code I can cut and paste, but I'm not sure if I did it right.

The formatting of the WORD document was fine.  I just printed it as a PDF, then opened up that document with LiveCycle to insert my fields and format them.

Avatar

Level 1

Alright, trying the tutorial.  I think I"m getting there, but maybe you can tell me what I'm doing wrong:

<variables>
                  <script contentType="application/x-javascript" name="Example1">var ServiceCat = {
                       Materials: [ ["-"], ["TEST1"], ["TEST2"], ["TEST3"],["TEST4"]],
                       Infrastructure: [ ["-"], ["TEST5"], ["TEST6"]],
                       Communications:  [ ["-"], ["TEST7"], ["TEST8"]],
                       Human Resources:[ ["-"], ["TEST9"], ["TEST10"]]
                     };      

function SetServiceEntries()
{
   Service.clearItems();
   Service.rawValue = null;
  
   var aService = ServiceCat[xfa.event.change];
   if(aService &amp;&amp; aService.length)
   {
      for(var i=0;i&lt;aService.length;i++)
        Service.addItem(aService[i][0],aService[i][1].toString());
   }
}

</script>

<field h="9.0001mm" name="Category" w="46.9392mm">
                  <ui>
                     <choiceList>
                        <border presence="hidden">
                           <?templateDesigner StyleID aped0?></border>
                        <margin/>
                     </choiceList>
                  </ui>
                  <font typeface="Myriad Pro"/>
                  <margin bottomInset="1mm" leftInset="1mm" rightInset="1mm" topInset="1mm"/>
                  <para vAlign="middle"/>
                  <border>
                     <edge/>
                     <corner thickness="0.1753mm"/>
                  </border>
                  <items save="1">
                     <text>-</text>
                     <text>Materials</text>
                     <text>Infrastructure</text>
                     <text>Communications</text>
                     <text>Human Resources</text>
                  </items>
                  <event activity="change">
                     <script contentType="application/x-javascript">Example1.SetServiceEntries();</script>
                  </event>
               </field>
               <field h="9.0001mm" name="Service" w="61.8363mm">
                  <ui>
                     <choiceList>
                        <border>
                           <?templateDesigner StyleID aped3?>
                           <edge stroke="lowered"/>
                        </border>
                        <margin/>
                     </choiceList>
                  </ui>
                  <font typeface="Myriad Pro"/>
                  <margin bottomInset="1mm" leftInset="1mm" rightInset="1mm" topInset="1mm"/>
                  <para vAlign="middle"/>
                  <border>
                     <edge/>
                     <corner thickness="0.1753mm"/>
                  </border>
                  <items save="1">
                     <text>Hello</text>
                     <text> </text>
                  </items>
               </field>