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

Michele Beltrame mb at cattlegrid.info
Fri Oct 31 09:06:27 GMT 2008


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.

Michele.

-- 
Michele Beltrame
http://www.cattlegrid.info/
ICQ 76660101 - MSN mb at italpro.net



More information about the HTML-FormFu mailing list