[html-formfu] Wrapping input inside <label>...</label> for Checkboxgroup

Carl Franks fireartist at gmail.com
Wed Mar 12 20:11:50 GMT 2008


On 12/03/2008, Steve Caldwell <info-formfu at caldwellhb.com> wrote:
> Carl Franks wrote:
>  > <input name="foo" type="checkbox" value="1" id="foo" />
>  > <label for="foo">One</label>
>  >
>  > It should also be possible to use CSS to make the checkbox render to
>  > the right-hand side of the label, if that's what you want.
>  >
>  >
>
>
> Carl, do you have any example CSS of how to do this?

Not off hand.
The CSS test app doesn't currently use the Checkboxgroup, but it does
have a Radiogroup that you can target to test with.

I'd forgotten though, that all fields have a reverse_multi() attribute
which is used in Multi blocks to decide whether to put the label or
input first.
It's value is true, by default, for Radio and Input elements.

We should probably edit the checkboxgroup_tag and radiogroup_tag
templates (and the internal string() methods) to honour either
reverse_multi(), or maybe create a new more-specific method to get the
same effect.

Carl



More information about the HTML-FormFu mailing list