2 Replies Latest reply on Feb 21, 2010 5:23 PM by venkatsyss

    Regarding - Checkbox Value




      My question is how i get the selected checkbox value in the database in php.


      The following code shows


      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="userRequest.send()">
      <mx:HTTPService id="userRequest" method="POST" useProxy="false" url="check.php" result="Display(event)">
          <mx:request xmlns="">


              import mx.events.ListEvent;
              import mx.rpc.events.ResultEvent;
              import mx.collections.ArrayCollection;
              import mx.controls.Alert;
              import mx.controls.DataGrid;
              [Bindable]private var arr:ArrayCollection;
              private function Display(event:ResultEvent):void{
              private function handleSelect(value:Boolean):void
                          function callback(item:*, index:int, array:Array):void
                              item.sel = value;
                  private function Update():void{
                   public function disp(event:ListEvent):void
                              var obj:Object=uRequest.selectedItem.userid;
                             // Alert.show("Checkbox=" + obj);




      <mx:DataGrid dataProvider="{arr}" id="uRequest" itemClick="disp(event)">
              <mx:CheckBox selected="{data.sel}">


          <mx:DataGridColumn headerText="Sl.No" dataField="userid"></mx:DataGridColumn>
              <mx:DataGridColumn dataField="username">
              <mx:DataGridColumn dataField="useremail">
              <mx:DataGridColumn dataField="userstate">
      <mx:Button label="CheckAll" click="handleSelect(true)">


      <mx:Button label="Update" click="Update()">


      Please provide me the solution to solve the problem.


      Thanks and Regards,


        • 1. Re: Regarding - Checkbox Value
          archemedia Level 4

          The selected property of a checkBox should be of Boolean type. Passing 0 or 1 won't work.


          When binding a checkbox to a integer value, do this:


          <mx:CheckBox id="cb" selected="{Boolean(data.selected)}"/>


          When binding to a string, do this:


          <mx:CheckBox id="cb" selected="{Boolean(int(data.selected))}"/>


          When passing it back, do:


          data.selected = int(cb.selected);



          • 2. Re: Regarding - Checkbox Value
            venkatsyss Level 1



            Thanks for your kind reply.


            I am using itemrenderer  to display checkbox in the datagrid.if i put id in the checkbox it will shows the error,id is not a attribute.


            How i get multiple selected checkbox id in the httpservice.


            Please provide me the solutions to solve the problem.



            Thanks and Regards,