Warning: Illegal string offset '_imagedir' in /home/cakephpf/public_html/lofiversion/index.php on line 545

Warning: Illegal string offset '_emodir' in /home/cakephpf/public_html/lofiversion/index.php on line 546
CakePHP UnOfficial Community Forum > Displaying checkboxes in li tag
Help - Search - Member List - Calendar
Full Version: Displaying checkboxes in li tag
CakePHP UnOfficial Community Forum > Layouts and Design

atlet
How can generate from From->imput, for multiple checkboxes this kind of "code":

CODE

<ul class="inputs-list">
<li>
<label>
<input type="checkbox" value="option1" name="optionsCheckboxes">
<span>Option one is this and that&mdash;be sure to include why it’s great</span>
</label>
</li>
<li>
<label>
<input type="checkbox" value="option2" name="optionsCheckboxes">
<span>Option two can also be checked and included in form results</span>
</label>
</li>
</ul>


Now I have this code:

CODE

echo $this->Form->input('User', array(
       'label' => FALSE,
       'type' => 'select',
       'multiple' => 'checkbox',
       'options' => $users,
       'selected' => $html->value('User.User'),
       'between'   => '<ul class="inline"><li>',
       'after' => '</li></ul>',
       'separator' => '</li><li>'
   ));


But instead of li tag I get all wrapped in div tag:

CODE

<ul class="inline">
<li>
<input id="UserUser" type="hidden" value="" name="data[User][User]">
<div class="xlarge">
<input id="UserUser4" type="checkbox" value="4" checked="checked" name="data[User][User][]">
<label class="selected" for="UserUser4">Andraž</label>
</div>
<div class="xlarge">
<input id="UserUser5" type="checkbox" value="5" checked="checked" name="data[User][User][]">
<label class="selected" for="UserUser5">Pinko</label>
</div>
</li>
</ul>
noahwilson
So nice post, thanks to share its really so useful script.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2014 Invision Power Services, Inc.
Lo-Fi 1.1 iDS Beta, Originally written by Matt,
re-written by Shaun Harrison, Layer 04.com, for pre IPB2.0 versions.