cakephp - Styling a FormHelper multiselect checkbox -


i had multiple checkbox:

<?php echo $this->form->input('power', array('type'=>'select', 'multiple' => 'checkbox', 'options' => $poderes, 'label' => false)); ?>

thats generate html:

<div class="input select"><input type="hidden" name="data[power][power]" value="" id="powerpower"/>  <div class="checkbox"><input type="checkbox" name="data[power][power][]" value="1" id="powerpower1" /><label for="powerpower1">negociacao</label></div> <div class="checkbox"><input type="checkbox" name="data[power][power][]" value="2" id="powerpower2" /><label for="powerpower2">comerciais</label></div> <div class="checkbox"><input type="checkbox" name="data[power][power][]" value="3" id="powerpower3" /><label for="powerpower3">compras</label></div> </div> 

i want put titlein <div class="checkbox"> , change class. tried many ways , not working.

how this?

tldr:

write manually php foreach()

explanation:

remember, cakephp php, @ field names / ids...etc auto-generates when $this->form->input(), , build foreach() loop writes out checkboxes in whatever manner want. voila!

cakephp awesome many things, every once in awhile need enough customization need fall ole' php instead.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -