1 Reply Latest reply on Feb 16, 2010 11:20 AM by toddwalthall

    How do I specify different emails for a form to send to based on different selections?

    toddwalthall

      How do I specify different emails for a form to send to based on different selections?

       

      Creating a form that can be sent to an email address is simple enoug but my problem I can't figure out.  There is a drop down menu on the form and based on what the user selects the form will be sent to 1 of 3 groups of email addresses.  How can I specify which group of email addresses belong to a particular dropdown menu selection?

        • 1. Re: How do I specify different emails for a form to send to based on different selections?
          Gregory Lafrance Level 6

          You can populate the drop down with a dataprovider that has the dropdown field and the emailgroup field.

           

          <?xml version="1.0" encoding="utf-8"?>
          <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
            <mx:Script>
              <![CDATA[
                import mx.events.FlexEvent;
                import mx.collections.ArrayCollection;
                
                [Bindable] private var dataAC:ArrayCollection = new ArrayCollection([
                  {label: "one", email: "one@one.com"},
                  {label: "two", email: "two@two.com"},
                  {label: "three", email: "three@three.com"},
                ]);
                
                private function changeFunc(evt:FlexEvent):void{
                  txt.text = evt.currentTarget.selectedItem.email;
                }
              ]]>
            </mx:Script>
            <mx:ComboBox id="cmbx" dataProvider="{dataAC}" valueCommit="changeFunc(event)"
              labelField="label" creationComplete="cmbx.selectedIndex=0"/>
            <mx:Text id="txt"/>
          </mx:Application>
          


          If this post answers your question or helps, please mark it as such.


          Greg Lafrance - Flex 2 and 3 ACE certified

          www.ChikaraDev.com

          Flex / AIR Development, Training, and Support Services