2008/8/28 Dermot <firstname.lastname@example.org>:
2008/8/28 Carl Franks <email@example.com>:
Are you setting value(1) on all the checkboxes?
No I am not. Here is the debug output I get from this code snippet:
Am I mistaken in thinking a true value for a checkbox element should
render 'checked="checked"' and an undef (or 0) will render the
Yes - you're mistaken ;)
It'll only give you checked="checked" if value() equals default()
That's the important part ^^^
If you see checkboxes as simply true/false boolean - and you're using
Catalyst-Controller-HTML-FormFu, then you can simply make all
checkboxes have a value="1" by setting this in your myapp.yml config
If you set that, the problem will be solved!
The reason that's not a default, is that checkboxes aren't always a
simple boolean - and it's so simple to set your own application-wide
defaults using the above construct.
Ok, I had been mistaken that the browser wouldn't send anything if a
checkbox doesn't have a value.
I've just checked all the browsers at my disposal, and they all send
the value "on" if there's no explicit value - so at least they're
However - I still don't think it's good to rely on that behaviour -
particularly if you intend on using HTML-FormFu-Model-DBIC.
If the checkbox relates to a BOOL column, then the checkbox should
have value="1", so that Model-DBIC can update the database correctly.
btw - If you do want to try using Model-DBIC for this - can you start
a new thread, and post the relevant DB schema and form config - I
couldn't quite follow your earlier description, so I'm not sure
whether Model-DBIC can do what you want (yet) ;)