[html-formfu] 'default_empty_value' doesn't work

Carl Franks fireartist at gmail.com
Fri Oct 31 09:23:29 GMT 2008


2008/10/31 Michele Beltrame <mb at cattlegrid.info>:
> Hi Juergen!
>
>> 3. add the suggested "default_if_unchecked" to formfu
>
> On secondo thought, this might not be a good idea. A checkbox, by
> definition, doesn't have a value if unchecked. If you have a:
>
> <input type="checkbox" value="1" />
>
> it's either "1" or nothing at all (undefined). The "empty_if_unchecked"
> thing is useful for testing, for instance, in when-constrained
> constraints, so is a good idea. As far as setting a value like "0",
> which doesn't really belong to the checkbox, I'm unsure.
>
> Transformers are probably the best way to go, in this case.

I would tend to agree with this assessment.

You'll still need to set default_empty_value(1) to ensure the
processors run on that field.

Carl



More information about the HTML-FormFu mailing list