As i understand how the forms and the $_POST/$_GET variables work:
If it's a checkbox and it's not checked, it doesnt show up in the $_POST/$_GET (could be wrong, didnt test)
You may want to consider either checking if it exists and if it doesnt, then set the value, or you could use a radio button group.

Hope this helps.

On 8/16/06, [EMAIL PROTECTED] <[EMAIL PROTECTED] > wrote:

I have a database table with a field of type enum('true','false') to
represent boolean data.  I'd like to use HtmlHelper's checkbox function
to edit values for this field.  This seems to work fine if the user
checks the checkbox, but leaves the db field blank if the user doesn't
check the checkbox:

$html->checkbox('Content/nav', null, array('value'=>'true',
'checked'=>'checked')

I understand that the 'value' attribute is used as the field's value if
the checkbox is checked.  Is there a way to set the value Cake will use
if the checkbox is *not* checked?

Would I be better off using some other type for this boolean field in
the database, so $html->checkbox() will just work without any weird
hacks on my part?



[EMAIL PROTECTED]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake PHP" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to