Hi!!!!!!!!!!!

please help me for select option list and  radio button  according to
database.

content in  edit.thtml  :-

<tr><td><label for="CategoryParentId">Category</label></td>
        <td><?php echo $html->selectTag('Product/category_id', $tree-
>show('Category/name', $CategoryArray, 'options'),'');?></td>
</tr>

<tr><td><label>Status:</label></td>
        <td>
<?php echo $html->radio('Product/status', array('Available' =>
'Available', 'Not Available' => 'Not Available'), null, array('value'
=> 'Available'));?></td></tr>

<tr><td><label>Featured:</label></td>
        <td><?php echo $html->radio('Product/is_featured', array('No' =>
'No','Yes' => 'Yes' ), null, array('value' => 'No'));?></td><td
width="40%"></td></tr>


content of controller :-

function edit($id) {

                $this->set('CategoryArray', $this->Product->Category-
>findAllThreaded(null, null,'parent_id'));


        if(empty($this->data)) {
                $this->data = $this->Product->read(null, $id);
        } else {
                $this->cleanUpFields();
                if($this->Product->save($this->data)) {
                        $this->Session->setFlash('The Product has been
saved');
                        $this->redirect('/products/index');
                } else {
                        $this->Session->setFlash('Please correct
errors below.');
                }
        }
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to