5 Replies Latest reply on Jun 29, 2011 11:43 PM by radzmar

    selections from drop down list into list box

    Brad Thurston

      Hello all, I have a ddlist that is filled from xml data. On select I would like selection to appear in the list box. I am not able to figure this out, can somone supply me with some direction.

        • 1. Re: selections from drop down list into list box
          radzmar Adobe Community Professional & MVP

          This simliest way is this script in the change:Event of the dropdown box:

          ListBox1.addItem(xfa.event.newText);
          • 2. Re: selections from drop down list into list box
            Brad Thurston Level 1

            That worked great. On a side note...is there something needed to get the a reset button to remove the data from the list box?

            • 3. Re: selections from drop down list into list box
              radzmar Adobe Community Professional & MVP

              To clear the Listbox use:

              ListBox1clearItems();
              • 4. Re: selections from drop down list into list box
                Brad Thurston Level 1

                Thanks much for the help. Still not able to clear the list box. Can you verify that I entered correctly?

                 

                <?templateDesigner expand 1?></subform>

                         <field name="ResetButton1" y="82.55mm" x="117.475mm" w="28.575mm" h="6mm" relevant="-print">

                            <?templateDesigner isResetFieldsObject true?>

                            <ui>

                               <button highlight="inverted"/>

                            </ui>

                            <font typeface="Myriad Pro"/>

                            <caption>

                               <value>

                                  <text>Reset Form</text>

                               </value>

                               <para hAlign="center" vAlign="middle"/>

                               <font typeface="Myriad Pro"/>

                            </caption>

                            <border hand="right">

                               <?templateDesigner StyleID apbx2?>

                               <edge stroke="raised"/>

                               <fill>

                                  <color value="212,208,200"/>

                               </fill>

                            </border>

                            <bind match="none"/>

                            <event name="event__click" activity="click">

                               <script contentType="application/x-javascript">xfa.host.resetData(); ListBox1.ClearItems();</script>

                            </event>

                         </field>

                         <?templateDesigner expand 1?></subform>

                • 5. Re: selections from drop down list into list box
                  radzmar Adobe Community Professional & MVP

                  The correct syntax is clearItems(); not ClearItems();