2 Replies Latest reply on Mar 11, 2010 5:57 AM by Sam Souhrada

    How to get Checkbox Value from Flex in PHP.

    minetgate

      Hi,

       

      I need to know how to get a checkbox value from flex in PHP-POST/GET because I don't know what is the value property of a checkbox in flex.

       

      Please Help.

        • 1. Re: How to get Checkbox Value from Flex in PHP.
          TanweerHq Level 2

          Hi,

          It is very simple. Follow the steps below to achieve the solution,

           

          1. Write a check-box change event to capture the value of the check box. Store this value in a variable(say bolChkSelected:Boolean).

          2. In step 1 you got the value of the check box. Now your aim is to send the value to php. Declare a httpService in your flex application(i think you are aware of using it).Ok..im writing it

           

          <mx:HTTPService id="sampleService" resultFormat='e4x' url='http://yourdomain/file.php' result='handleResult()' fault='handleFault()'>
          </mx:HTTPService>

          3. Now the actual solution... u need to send the shcStatus in to php..

          Declare an object to hold the data

          var objparameters:Object={};

          objparameters['CheckBoxdata'] = bolChkSelected;

           

          --in the above line... 'CheckBoxdata' is used as a parameter to php..you shud have the same variable name while accessing in php file also..

          in php file..

          checkboxstatus = $_POST[''CheckBoxdata''];

          echo checkboxstatus

           

          thats it..

          1 person found this helpful
          • 2. Re: How to get Checkbox Value from Flex in PHP.
            Sam Souhrada Level 1

            Here is a very basic example of sending data to/from PHP:

             

            http://www.riaindy.com/adobe/2010/02/adobe-flex-php-integration/

             

            This could easily be converted to sending a true or false value for a checkbox.

            1 person found this helpful