Hi Dave
two things
On 21 Dec 2009, at 00:41, Dave wrote:
> I have been struggling with the idea of simply adding a input field to for
> every select box produced from a HABTM find('list) and tried everything I can
> think of and nothing.
>
> The closest was doing a foreach loop thru the $list to create checkbox and
> input for each. I can get the checkboxes to generate the exact code produced
> by cake but then nothing is selected. Tried dropping the HABTM idea and going
> with the hasMany belongsTo ideas as mentioned in the cookbook and that was a
> disaster. I am just stumped to the fact that that not 1 person has any ideas!
> The guys who wrote the entire cake code, the contributors, the community. I
> have stumped everyone?
>
> Maybe I will edit the form helper and create my own custom
> $form->addCheckfield method which will add the input automatically for every
> checkbox, but who knows. I just thought it was a simple idea that maybe
> someone has come across or even had an idea to do, but by the lack of
> response to the question i guess not 1 singlebaker in the community as large
> a this has ever toyed with the idea.
two things.
firstly your answer
<?php
echo $form->input('ModelName',array('label'=>'label','type'=>'select',
'multiple'=>'checkbox'));
?>
Adding multiple checkbox to your input array will provide checkboxes where you
might have had a multiple select.
secondly - I appreciate you have a problem but you can't blame list subscribers
for not giving you an answer. Especially if you post it on a friday. I cant
imagine many people have been following this list over the weekend instead they
are christmas shopping and getting merry.
In the future, also ensure your subject is relevant. '3 days and not 1 person
has any idea' doesn't describe a problem that anyone reading email titles would
look at.
Searching for 'cakephp multiple checkbox' on google found this result on the
first page
http://stackoverflow.com/questions/1267230/cakephp-form-helper-habtm-multiple-checkbox-styling
You'd also have found the answer in book.cakephp.org
http://book.cakephp.org/view/193/options-multiple
merry xmas
mikek
--
Mike Karthäuser
Managing Director - Brightstorm Ltd
Email: [email protected]
Web: http://www.brightstorm.co.uk
Tel: 07939 252144
Address: 1 Brewery Court, North Street, Bristol, BS3 1JS
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