Hey there
i was wondering wheater i have been using the form->input function the
wrong way here, or if this is supposed to be working..
foreach ($pollOptions as $p) {
echo $form->input('Form.vote',array('type'=>'radio','options'=>array
('s'.$p['id']=>$p['name'])));
//echo $form->radio('Form.vote',array($p['id']=>$p['name'])); // does
not work either
....
}
always results in somethink like this:
<div class="input radio"><input type="hidden" name="data[Form][vote]"
id="FormVote_" value="" /><input type="radio" name="data[Form][vote]"
id="FormVoteS4" value="s4" /><label for="FormVoteS4">optionA</label></
div><div class="input radio"><input type="hidden" name="data[Form]
[vote]" id="FormVote_" value="" /><input type="radio" name="data[Form]
[vote]" id="FormVoteS5" value="s5" /><label for="FormVoteS5">optionB</
label></div><div class="input radio"><input type="hidden" name="data
[Form][vote]" id="FormVote_" value="" /><input type="radio" name="data
[Form][vote]" id="FormVoteS6" value="s6" /><label
for="FormVoteS6">optionC</label></div>
note the 3 hidden inputs with id="FormVote_" and an empty value. this
is sure not correct, as an ID should only exist once on a page
the result is, that the content of the form only gets submitted (or
validated and returned) if the last one of the above options is
selected. if you select any other option, the form renders invalid,
$_POST is empty and nothing is selected after page refresh.
i have no security comp. on
i need to loop through an array and build it up this way because each
checkbox has some more stuff to be added to it (pictures and text),
that does not fit into "seperator" or something like that.
after all i wonder how i can set up simple radio button lists with a
foreach() loop that will do the trick.
thx
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---