What happens when you just use $this->Form->input() instead? It ought to still render as a checkbox.
Jeremy Burns Class Outfit [email protected] http://www.classoutfit.com On 10 Feb 2011, at 06:14, andy_the ultimate baker wrote: > hoi > i m trying to save values of check boxes which has property tinyint(1) > > but its going 0 even in $this->data has the values 1 > > my controller is as fallows > > > function procedures() { > > if(!empty($this->data)){ > //print_r($this->data);exit; > $this->TreatmentProcedure->create(); > if ($this->TreatmentProcedure->saveAll($this->data)) { > $this->Session->setFlash('the procedure has been saved', true); > $this->redirect(array('action'=>'procedures')); > }else{ > $this->Session->setFlash('the procedure could not be saved', > true); > $this-> redirect(array('action'=>'procedures')); > } > > } > > } > > my view is as fallows > > <table width="100%" border="0" cellspacing="0" cellpadding="0"> > <tr> > <td colspan="2" valign="top" class="txt- > black"><table width="100%" border="0" cellspacing="0" cellpadding="0" > class="txt-black"> > <tr> > <td width="2%"><?php echo $this->Form- >> checkbox('bone_marrow_aspiration'); ?></td> > <td width="49%">Bone Marrow Aspiration</td> > <td width="2%"><?php echo $this->Form- >> checkbox('trifine_biopsy'); ?></td> > <td width="47%">Trifine Biopsy</td> > </tr> > <tr> > <td><?php echo $this->Form- >> checkbox('cytogenetics'); ?></td> > <td>Cytogenetics and Flow Cytometry</td> > <td><?php echo $this->Form- >> checkbox('lumbar_puncture'); ?></td> > <td>Lumbar puncture</td> > </tr> > <tr> > <td><?php echo $this->Form- >> checkbox('csf_collection'); ?></td> > <td valign="top">CSF Collection</td> > <td><?php echo $this->Form- >> checkbox('intrathecal'); ?></td> > <td>Intrathecal</td> > </tr> > <tr> > <td><?php echo $this->Form- >> checkbox('trucut_biopsy'); ?></td> > <td >Trucut Biopsy</td> > <td><?php echo $this->Form- >> checkbox('central_line'); ?></td> > <td>Central Line</td> > </tr> > <tr> > <td><?php echo $this->Form- >> checkbox('pleural_tapping'); ?></td> > <td>Pleural Tapping</td> > <td><?php echo $this->Form- >> checkbox('peritoneal_tapping'); ?></td> > <td>Peritoneal Tapping</td> > </tr> > > </table></td> > > i have checked all the values and field are right but instade of 1 its > going 0 in table > > please helpme > > -- > Our newest site for the community: CakePHP Video Tutorials > http://tv.cakephp.org > Check out the new CakePHP Questions site http://ask.cakephp.org and help > others with their CakePHP related questions. > > > To unsubscribe from this group, send email to > [email protected] For more options, visit this group at > http://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php
