Reputation: 391
Can we do something like image below on cakephp. If can, how to do it? I am struggle with it. I try to find any answers but can not found something like this. Any answers for this problem will be great appreciated.
Upvotes: 1
Views: 972
Reputation: 1
multiple dropdown options with checkbox in cakephp error
<div class="col-md-2 place-grid">
<h5>Property Type</h5>
<?php $allCategories=$this->Common->getCategories(); ?>
<?php echo $this->Form->input('ptype',array('options' =>$allCategories,'style'=>'width:150px;','error'=>false,'id'=>'ptype','onchange'=>'getIdType()','div'=>false,'label'=>false,'empty'=>'Select Type','class'=>"sel")); ?>
<?php if($this->Form->error('ptype')){?>
<?php echo $this->Form->error('ptype',array('style'=>'txtError'));?>
<?php } ?>
</div>
<div class="col-md-2 place-grid">
<h5>Sub Type</h5>
<?php $allSubCategories=$this->Common->getArticleSubCategories(); ?>
<?php echo $this->Form->input('sptype',array('options'=>'', 'style'=>'width:150px;','error'=>false,'div'=>false,'select'=>true,'label'=>false,'empty'=>'fgfg','class'=>"sel")); ?>
</div>
Upvotes: 0
Reputation: 1753
This can also be done with Bootstrap as well. The functionality is generally the same as @Anubhav 's answer from a bit earlier, however this is a little cleaner and a more up to date solution. The Bootstrap Framework is maintained/updated a lot more frequently.
See here for full solution:
Bootstrap dropdown checkbox select
Upvotes: 2
Reputation: 1623
No you cant do this using only CakePHP... but the above thing can be done using jQuery.
Please follow the link and your task will be done easily
http://dropdown-check-list.googlecode.com/svn/trunk/doc/dropdownchecklist.html
Cheers
Upvotes: 0