Thank you for this help.As per your advice i have changed my
controller to -
$categories = $this->Product->Category->find('list',
array( 'conditions' => array('isActive' => 'Y')));
$this->set(compact('categories'));
And view -
<?php echo $form->select('Product.categoryId', array('options' =>
$categories)); ?>
But it is giving html like this-
<option value=""></option>
<optgroup label="options">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</optgroup>
</select>
But as per my requirement it should be
<option value="">Select</option>
<option value="1">CategoryName1</option>
<option value="2">CategoryName2</option>
<option value="3">CategoryName3</option>
</select>
What change I have to do? Plz help me.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---