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>