4 Replies Latest reply on Nov 21, 2007 8:54 AM by Newsgroup_User

    Multiple ComboBoxes and Forms

    ScottE
      Hi All,

      I have a form with multiple ComboBoxes. I can only get the first value to send to email. I'm not sure what I'm doing wrong but this is the latest AS I've tried:

      //Drop Down Data

      objComboListener = new Object();
      objComboListener.change = function(eventObj){
      stateDD.text = eventObj.target.value;
      };
      stateDD.addEventListener("change", objComboListener);

      objComboListener.change = function(eventObj){
      contactDDbox.text = eventObj.target.value;
      }
      contactDDbox.addEventListener("change", objComboListener);

      The stateDD value goes but the contactDD value doesn't go - I just have a blank field in the email that was generated from the php file.

      Can someone plz help!

      Thanks,
      Scott
        • 1. Re: Multiple ComboBoxes and Forms
          Level 7
          You need to have a different name for each listener. Try this:


          objComboListenerA = new Object();
          objComboListenerA.change = function(eventObj){
          stateDD.text = eventObj.target.value;
          };
          stateDD.addEventListener("change", objComboListenerA);

          objComboListenerB = new Object();
          objComboListenerB.change = function(eventObj){
          contactDDbox.text = eventObj.target.value;
          }
          contactDDbox.addEventListener("change", objComboListenerB);


          --
          Dan Smith > adobe community expert
          http://www.dsmith.tv


          "ScottE" <selkins1@nc.rr.com> wrote in message
          news:fhvplq$r5k$1@forums.macromedia.com...
          > Hi All,
          >
          > I have a form with multiple ComboBoxes. I can only get the first value to
          > send to email. I'm not sure what I'm doing wrong but this is the latest
          > AS
          > I've tried:
          >
          > //Drop Down Data
          >
          > objComboListener = new Object();
          > objComboListener.change = function(eventObj){
          > stateDD.text = eventObj.target.value;
          > };
          > stateDD.addEventListener("change", objComboListener);
          >
          > objComboListener.change = function(eventObj){
          > contactDDbox.text = eventObj.target.value;
          > }
          > contactDDbox.addEventListener("change", objComboListener);
          >
          > The stateDD value goes but the contactDD value doesn't go - I just have a
          > blank field in the email that was generated from the php file.
          >
          > Can someone plz help!
          >
          > Thanks,
          > Scott
          >


          • 2. Re: Multiple ComboBoxes and Forms
            ScottE Level 1
            Hi Dan,

            I already tried that and it doesn't work. For some reason it only passes on the value for the first CheckBox. <sigh>

            Thanks,
            Scott
            • 3. Re: Multiple ComboBoxes and Forms
              ScottE Level 1
              Hi Dan,

              I copy and pasted your code and I was off by one ; . It DOES work and I can't thank you enough!

              Many Thanks and Happy Thanksgiving to you and your family bro!

              Scott
              • 4. Re: Multiple ComboBoxes and Forms
                Level 7
                Glad it works. Happy Holidays.


                --
                Dan Smith > adobe community expert
                http://www.dsmith.tv

                "ScottE" <selkins1@nc.rr.com> wrote in message
                news:fhvvfa$3qt$1@forums.macromedia.com...
                > Hi Dan,
                >
                > I copy and pasted your code and I was off by one ; . It DOES work and I
                > can't thank you enough!
                >
                > Many Thanks and Happy Thanksgiving to you and your family bro!
                >
                > Scott