4 Replies Latest reply on Jan 30, 2007 1:46 PM by karina_a

    ComboBox and php

    karina_a
      Dear everyone..
      i have some problems for sending the data of a combo box to a php script.
      this is the line
      <mx:ComboBox x="202" y="59" id="id_city" dataProvider="{feedCombo.lastResult.city.city_bol}" change="feedRequest.send()"/>

      And i need the data of the combobox to generate an other sql sentence.

      hopefully someone has done something similar...
      THANK YOU so much for your help in advance,

      Karina
        • 1. Re: ComboBox and php
          karina_a Level 1
          hmm maybe i have to clarify my question, so hopefully someone knows :S

          the combobox is already loading the information from a table, what i need to do is binding the selectedItem.data with a php script, so the php script can generate a sql sentence.

          <mx:HTTPService
          id="feedRequest"
          url=" http://localhost/flex/php/req.php"
          useProxy="false" method="POST"/>

          <mx:ComboBox x="202" y="59" id="id_city" dataProvider="{feedCombo.lastResult.city.city_bol}" change="feedRequest.send()"/>

          how i make to know to the php script that a specifically item was selected.

          tx so much in advance,
          Karina
          • 2. Re: ComboBox and php
            JeffreyGong Level 1
            Hi karina_a,

            Create a function like

            private function sendParams():void {
            var params:Object = new Object();
            params.selectedCity = id_city.selectedItem.label;
            feedRequest.send(params);
            }

            and let your comboBox change event call this function like

            change="sendParams()"


            Hope it helps,

            Jeffrey
            • 3. Re: ComboBox and php
              karina_a Level 1
              tx so much jeffrey for the response...
              i am continue confused eventought since i am really new in flex... i dont underestand how i am going to call the parameters in php $_POST['params']???

              tx again,
              karina
              • 4. Re: ComboBox and php
                karina_a Level 1
                finally i think i have already got a solution:
                <mx:HTTPService
                id="feedRequest"
                url=" http://localhost/flex/php/req.php"
                useProxy="false" method="POST">
                <mx:request>
                <id>{cb_city.selectedIndex+1}</id>
                </mx:request>
                </mx:HTTPService>

                with: change={feedRequest.send()}

                it works...

                tx sooo much for ur replies,
                Karina