⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

dynamic dropdown from database in add template



Faisal Naseer
  • profile picture
  • Member

Posted 31 December 2015 - 13:32 PM

I am having two relations first one category/second one product and the roduct relation contains the foreign key from the category relation. in my add template of product I wan to have a dynamic dropdown to select form categories. Right now I'm using this way.

 $crud->field_type('cat_id','dropdown', array('1' => 'Boxes', '2' => 'Supliments'));

but its is creating a static dropdown. As if any new category is added it doesn't reflect change over here and if i don't specify this I get a simple input field where I have to specify category myself. Right now I am using bootstrap theme. Is there any way I can create a dynamic dropdown.


Amit Shah
  • profile picture
  • Member

Posted 06 January 2016 - 02:38 AM

Please checkout for the forum for simple dependent dropdown - for dependent dropdown, there are atleast 2 solutions available. Please check them out whichever suites you.

 

Happy GCing :)