Right but all that does is give me 1 cleaned row with 3 going across with a clear after the fieldset. I need each 3 to be 1 div <div class="my_class"> checkbox 1, 2, and 3 </div> <div class="my_class"> checkbox 4, 5, and 6 </div> <div class="my_class"> checkbox 7, 8, and 9 </div> <div class="my_class"> checkbox 10, empty, empty </div>
The checkbox count is not static so that’s why foreach was the idea I came up with. I have 3 floating across now as you have yours set up but I want to separate / divide the rows with some graphics / lines so its not just a chunk of text and boxes, that’s where the 3 per div / separate next 3 / separate and so on comes in. Thanks Dave -----Original Message----- From: cricket [mailto:[email protected]] Sent: November-24-10 11:54 PM To: [email protected] Subject: Re: Manually make multiple checkbox? This works for me: echo $form->select('Options', $optionss, null, array('multiple' => 'checkbox')); css: div.checkbox { margin-bottom:1.5em; float: left; margin-right: 1em; width:10em;} fieldset:after {content:"\0020";display:block;height:0;clear:both;visibility:hidden;overflo w:hidden;} The 2nd rule adds some hidden content after the fieldset that is set to clear the floating divs (so the following content doesn't run into it). On Wed, Nov 24, 2010 at 9:44 PM, Dave Maharaj <[email protected]> wrote: > I have my data array from find->list and made a multiple checkbox set. > > Problem is I want more than 1 per row so im trying to do a foreach and > manually create the checkbox wrapped inside my div so I can get 3 across per > row, end row start new. > > I have the layout fine with the css ending after 3 </div> start new row > <div> > <div class="chechrow">checkbox</div> > <div class="chechrow">checkbox</div> > <div class="chechrow">checkbox</div> > </div> > > <div> > <div class="chechrow">checkbox</div> > <div class="chechrow">checkbox</div> > <div class="chechrow">checkbox</div> > </div>..so on you get the idea > > > Problem is it wont work. > > Standard data set array( > [0] => Something > [1] => Something Else) > > So I loop thru each > > <?php foreach ($option as $key => $value):?> > > <?php echo $this->Form->input( 'Option', array( 'type' => 'checkbox', > 'label' => $value, 'value' => $key, 'div' => false, 'legend' => false)):?> > > I get input hidden with each one. > > <input type="hidden" name="data[Option][ Option][]" id=" OptionOption_" > value="0" /><input type="checkbox" name="data[Option][ Option][]" > label="Arts and Culture" value="" id="JobDutyJobDuty"/></div> > > If I debug $key I get the value yet it never shows up in the code value = 0? > And why all the hidden elements? > > I added what appears on the regular input multiple checkbox section and > added that before my foreach => <input type="hidden" > name="data[Option][Option]" value="" id="OptionOption" /> > > Anyone see where I have gone wrong? > > Thanks, > > Dave > > > > > > Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. > > You received this message because you are subscribed to the Google Groups "CakePHP" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en > Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
