I'm pretty new to CakePHP. I have a drop down menu, in which the data
comes from DB. Following is the code for that.
In Controller file
function step_one(){
$suppliers = $this->Supplier->find('all', array('fields' =>
'Supplier.name'));
$this->set('suppliers',$suppliers);
}
View file
$a = array();
$i=1;
foreach( $suppliers as $supplier ):
$a[$i] = $supplier['Supplier']['name'];
$i++;
endforeach;
echo $form->input('Supplier ', array('options' => $a));
This creates a drop down menu. On change I want to have another drop
down in which the data is fetched from DB.
Thanks In advance
:)
Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
No comments:
Post a Comment