On Oct 27, 2005, at 12:10 PM, Andy Dustman wrote:
That's one problem I'm trying to solve now: I have a list of
checkboxes, using ids pulled from a table, and I need to figure out
the
best way to encode these. My first attempt was to give each checkbox
the same name (audience, in this case) and make value=id. This
works if
I don't have a validator, because the problem is, if multiple
checkboxes are selected, I get a list, but if only one is selected, I
get a single item (string).
Subway had a similar problem until recently. Peter Hunt made some
changes
to FormEncode (revisions 1128 and 1129). Now it works such that
if any of the checkboxes with the same name are checked, you get a list
of the values, even if only one is checked.
If none are checked, you get False.
And I don't know if this translates over to TG either since Subway
uses a schema which is automatically created from the view's HTML using
htmlfill_schemabuilder.