开发者

How to add a select all checkbox

开发者 https://www.devze.com 2023-04-02 18:59 出处:网络
I have this line: echo $form->input(\'management_categories\',array(\'options\' => $instrumentCategoriesManagement,\'type\' =&开发者_Go百科gt; \'select\',\'multiple\' => \'checkbox\',\'selec

I have this line:

echo $form->input('management_categories',array('options' => $instrumentCategoriesManagement,'type' =&开发者_Go百科gt; 'select','multiple' => 'checkbox','selected' => $management_categories));

How can I add an additional checkbox that says "Select all" at the beginning?

Thanks in advance


I don't know if it works for checkbox:

echo $form->input('management_categories',array('options' => $instrumentCategoriesManagement,'type' => 'select','multiple' => 'checkbox','selected' => $management_categories,'empty'=>'Select all'));

To actually achieve the effect, you'll need to write js code.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号