So: In a form with a group of checkboxes, all having the same name but
different values, the venerable cgi.FieldStorage will return all the
selected values as a single list (more or less). But in webapi.py,
input() seems to be clobbering those lists with dictify(), so while
web.input() associates only the last selected value with that group's
name.

For example:
    <form method="GET" action="/robot">
        <p>Select which appendages your robot will have.</p>
        <p><input type="checkbox" name="parts" value="head" />Head</p>
        <p><input type="checkbox" name="parts" value="l_arm" />Left
arm</p>
        <p><input type="checkbox" name="parts" value="r_arm" />Right
arm</p>
        <p><input type="checkbox" name="parts" value="l_leg" />Left
leg </p>
        <p><input type="checkbox" name="parts" value="r_leg" />Right
leg</p>
    </form>
...
    i = web.input()
    for part in i.parts:    # FAIL
        robot.add_part(part)

I understood that to be the 'right way' to handle a list of options
with CGI. Am I mistaken? How should it be done with web.py? I'd be
tempted by forms.py but the documentation's a bit thin.

Thanks!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to