Re: Checkboxes

"A Monkey" <[email protected]>
Newsgroups gmane.comp.python.formencode
Message-ID <[email protected]>
Hi Mike,

On Jan 29, 2008 7:41 PM, Mike Orr <[email protected]> wrote:
> Htmlfill doesn't check checkboxes when the value is true.  This partly
> defeats the purpose of using it.
>
> As a workaround I'm setting the "checked" attribute in the source HTML
> if the value is true.

I think that htmlfill works, but maybe not the way that you expect.
Does your checkbox have a "value" attribute? If your checkbox has a
"value" attribute then htmlfill will mark your checkbox as checked
only if the value specified in the defaults matches the "value"
attribute of the checkbox. If the checkbox has no "value" attribute,
then specifying a default value of True will leave it checked.

I'm pretty sure that's been my experience with it. I hope it helps.

Regards,
Matthew

P.S. the source: http://formencode.org/formencode/htmlfill.py.html?f=15&l=76#394

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.