Is there a way to produce _checked_ multiple checkboxes using form
helper with unique id for each. Currently I'm using this code in my
view template:
$form->input('EmployeeMailboxEmail.7.employee_mailbox_id.', array
('type'=>'select', 'multiple'=>'checkbox', 'label'=>false,
'options'=>array(8=>'Test'), 'checked'=>true));
and html result is:
<div class="checkbox">
<input type="checkbox" id="EmployeeMailboxEmailEmployeeMailboxId8"
value="8" name="data[EmployeeMailboxEmail][7][employee_mailbox_id][]"/
>
<label for="EmployeeMailboxEmailEmployeeMailboxId8">Test</label>
</div>
There is two improvements I can't achieve:
1. I want checkboxes to be checked by default.
2. Generated id for every checkbox is not affected by value of $num so
as a result there's a lot of checkboxes wit same id - is there any way
to set id for checkboxes, for example:
"EmployeeMailboxEmail7EmployeeMailboxId8" - note the difference in
number 7 compared to EmployeeMailboxEmailEmployeeMailboxId8
--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---
No comments:
Post a Comment