After looking deeply at the source code in helper.php and form.php, I
understood that the form helper is not designed to accept the
'default' value for checkboxes and radio buttons. (I also understood
that my code change 2 above was not correct.)

When I pass 'default' value to $form->input() method, it can only set
the default value to the <input> tag, not for the value of the field.
For the inputs which type is something like "text", it sets the
"value" of the field, but for those which type is "checkbox" and
"radio", the "default" value sets the value that is passed when it's
checked, not the value of the field.

I still think that the form helper should support default value for
checkboxes and radio buttons, but it seems that it requires quite a
few code changes. :(

Looks like we have to write a code to switch the default "checked"
state by ourselves for now.

Kizuki


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