Wednesday, September 17, 2008

checkbox value becomes default (1) after submit

Hi,

I have a checkbox with a particular value in a form, here is the
code :

<?php echo $form->checkbox('Task.repeated_task', array('value' =>
'yes', 'checked' => 'unchecked')); ?>

The first loading of the form is correct, the generated html is :

<input type="checkbox" name="data[Task][repeated_task]"
value="yes" id="TaskRepeatedTask" />

but after one submit, the value change to 1 and the generated html
becomes :

<input type="checkbox" name="data[Task][repeated_task]"
value="1" id="TaskRepeatedTask" />


Thanks for your help,

Seb
--~--~---------~--~----~------------~-------~--~----~
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: