Exactly! I need to manually create what cake creates automatically from a
multiple checkbox form and insert my new input field for my additional field
for my HABTM after each checkbox.



This is where I am stuck. I can get the fields but no checkbox is ever
selected.

<?php foreach ($selections as $key => $name)
                {
                        
                        
                        
                        
                        echo $form->input('Skill', array('type' =>
'checkbox', 'label' => $name , 'value' => $key));
                        echo $form->input('Skill.Skill.year', array('label'
=> 'Years Experience:', 'class' => 'text'));
                        

         
                }
  
        ?>

Thanks and sorry guys.

Dave
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf
Of BrendonKoz
Sent: December-21-09 4:25 PM
To: CakePHP
Subject: Re: 3 Days and not 1 person has any idea?

Ah, I think I understand what you meant now...

If the checkboxes are populated properly with the code that CakePHP created
automatically, you would need to be completely certain that the code you
create with your foreach loop duplicates the code exactly (including the
hidden form element, the id, the value, and the name of each input)
otherwise Cake might not understand the form fields in the way that you'd
like it to.

On Dec 21, 1:54 pm, "Dave" <[email protected]> wrote:
> Ok please, please how can I describe this so people understand what 
> the problem is since no body is understanding the situation.
>
> When you have a HABTM and in the form you have input as multiple => 
> checkbox you end up with multiple checkboxes.
> Those checkboxes are all spit out back to back or in a block (I am 
> referring to the code, not the look or style, the html is what I am 
> talking about) so you have
>
> <div class="options_select"><input name="data[Skill][Skill]" value=""
> type="hidden">
>
> <input name="data[Skill][Skill][]" value="9" id="SkillSkill9"
> type="checkbox"><label for="SkillSkill9">some name</label> <input 
> name="data[Skill][Skill][]" value="10" id="SkillSkill10"
> type="checkbox"><label for="SkillSkill10">some name</label> <input 
> name="data[Skill][Skill][]" checked="checked" value="7"
> id="SkillSkill7" type="checkbox"><label for="SkillSkill7"
> class="selected">some name</label>
> <input name="data[Skill][Skill][]" value="4" id="SkillSkill4"
> type="checkbox"><label for="SkillSkill4">some name</label> <input 
> name="data[Skill][Skill][]" checked="checked" value="5"
> id="SkillSkill5" type="checkbox"><label for="SkillSkill5"
> class="selected">some name</label>
> <input name="data[Skill][Skill][]" value="3" id="SkillSkill3"
> type="checkbox"><label for="SkillSkill3">some name</label> <input 
> name="data[Skill][Skill][]" checked="checked" value="2"
> id="SkillSkill2" type="checkbox"><label for="SkillSkill2"
> class="selected">some name</label>
> <input name="data[Skill][Skill][]" value="6" id="SkillSkill6"
> type="checkbox"><label for="SkillSkill6">some name</label> <input 
> name="data[Skill][Skill][]" value="1" id="SkillSkill1"
> type="checkbox"><label for="SkillSkill1">some name</label> <input 
> name="data[Skill][Skill][]" checked="checked" value="8"
> id="SkillSkill8" type="checkbox"><label for="SkillSkill8"
> class="selected">some name</label>
> <input name="data[Skill][Skill][]" value="11" id="SkillSkill11"
> type="checkbox"><label for="SkillSkill11">some name</label> </div>
>
> So now I need my additional field to be beside each checkbox. But 
> since this code above gets created by cake there is no way for me to 
> get my additional field to appear after EACH checkbox so what I have 
> done is a foreach to manually create the code above and insert my 
> additional field after each check box but the checkboxes are not
populated.
>
> Anyways that's for your time I will figure it out onmy own.
>
> -----Original Message-----
> From: [email protected] [mailto:[email protected]] On 
> Behalf Of Jon Bennett
> Sent: December-21-09 8:37 AM
> To: [email protected]
> Subject: Re: 3 Days and not 1 person has any idea?
>
> Hi Dave,
>
> > 1 form, find->('list), list is array of Skills, $skills is a HABTM 
> > form for User to select thiere appropriate skills from, I added "year"
> > to the HABTM
>
> Ahh, ok. What you want to be searching for is "saving extra data habtm 
> join cakephp", which is in the docs (only helps if you know what 
> you're looking for!).
>
> http://www.google.com/search?client=safari&rls=en&q=saving+additional...
> n+habtm+join+cakephp&ie=UTF-8&oe=UTF-8
>
> Cheers,
>
> Jon
>
> --
> jon bennett -www.jben.net- blog.jben.net
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd 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 
> cake-php+group athttp://groups.google.com/group/cake-php?hl=en
> No virus found in this incoming message.
> Checked by AVG -www.avg.com
> Version: 9.0.717 / Virus Database: 270.14.114/2575 - Release Date: 
> 12/20/09 16:05:00
>
>

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 
cake-php+at http://groups.google.com/group/cake-php?hl=en
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.717 / Virus Database: 270.14.114/2575 - Release Date: 12/21/09
04:06:00

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

Reply via email to