A community in which webmasters can ask for help with topics such as PHP coding , MySQL , IT jobs, web design, IT security.
Current location:homephp forumphp talk in 2008 yearHow do I implement Advanced combobox in CakePHP? - page 1
User InfoPosts
How do I implement Advanced combobox in CakePHP?#1
I have implemented combobox in cakephp using following statement -

echo $form->select('brand_id',array($brands),null,array(),'Choose Brand');

for brand and input form for category -

echo $form->input('category_id',array('type'=>'select',$categories,'empty'=>'Choose Category'));

but none of above option allows me to add my text input to brand or category, like say I want to add an input which is not there in the combobox, how should i go about it.

Like a link in the combobox or textbox in combobox?


posted date: 2008-12-11 02:57:00

Re: How do I implement Advanced combobox in CakePHP?#2
I had made out the solution of this problem. click to view my topic...

hope that hepls.

posted date: 2008-12-11 02:57:01

Re: How do I implement Advanced combobox in CakePHP?#3
Have 2 "other" fields:echo $form->input('brand_other');echo $form->input('category_other');You'll either need 2 more fields in your database table for the model of this form, or logic in your controller that adds values posted in these "other" fields to your brands and categories tables, then add the inserted IDs to $this->data brand_id and category_id before saving this model.Also, you can use the $form->input() method for both select boxes, and you don't need to explicitly send it $brands or $categories vars, if they are available in your view the form helper will detect this and print a select box automatically.

posted date: 2008-12-12 01:42:00

select page: « 1 »
Copyright ©2008-2017 www.momige.com, all rights reserved.