Do you need checkboxes from multiple tables?  If so you need to use the
trick I posted earlier today to make the hidden elements not be duplicated.
Overload your form.php in your app/views/helpers folder.

What you are doing is similar to a recent application that I wrote, in which
I developed this extention to the form->input method to accomplish just this
effect.

See the message "re: Ticket #5577 (new Enhancement)"  If this is what you
need.

-----Original Message-----
From: cake-php@googlegroups.com [mailto:cake-...@googlegroups.com] On Behalf
Of Tony Thomas
Sent: Thursday, January 15, 2009 4:52 PM
To: CakePHP
Subject: Re: Label information for Multiple Checkboxes


The complicating factor here is that Aliquot belongs to Specimen in my
model and I want to display some information from both tables:
Specimen.type, Specimen.draw_date, Aliquot.additive & etc. It looks
more and more like I'm going to have to put that information in an
array and loop through it, building each checkbox one at a time
instead of my example below. Or am I missing something?

On Jan 15, 11:01 am, grigri <j...@hendersonwebdesign.com> wrote:
> You need to set the $displayField property inside your `Aliquot` model
> to whatever field you want for the label.
>
> On Jan 15, 4:47 pm, Tony Thomas <truet...@gmail.com> wrote:
>
> > I'm building a list of checkboxes like so:
>
> > echo $form->input('Aliquot.id', array( 'label' => FALSE,
> >                                                                        
        'type' => 'select',
> >                                                                        
        'multiple' => 'checkbox',
> >                                                                        
        'options' => $aliquots));
> > echo $form->input('box_id', array('options' => $boxes));
>
> > $aliquots above is built from $this->Aliquot->find('list', $options);
> > which finds all the ids of the pertinent records. The problem I have
> > this this only generates a list of ids. Is there good way to load an
> > array for 'label' so that I can display more than just the list of ids?




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to