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

Juergen Mathwich jux at 4950.net
Fri Oct 31 09:51:27 GMT 2008


Am Freitag 31 Oktober 2008 10:23:29 schrieb Carl Franks:
> 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.

ok, right. I guess that's the best solution.
Maybe a hint could be added to pod to clarify the behavior of 
default_empty_value ... I spoke to other developers and they also 
misunderstood it :)

Thanks, Juergen



More information about the HTML-FormFu mailing list