#775 closed defect (invalid)
encodeForm doesn't handle multiple checkboxes / multi-select
Reported by: | Owned by: | anonymous | |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | General | Version: | 0.3 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
encodeForm adds a new variable of the same name on the query string for each checked checkbox in a group that have the same 'name' property, giving you weird-looking results like 'foo=asdf&boo=12&boo=37&boo=42.' :) And of course, trying to retrieve the value the standard way with a scripting language like Perl or Ruby on the server side (e.g., cgiboo?) only pulls out the first value.
Multiple-selects have the same problem.
I have made a small patch to serialize the values for checked/selected items in multi-selects or groups of same-name checkboxes into a comma-separated list -- you'll get 'foo=asdf&boo=12,37,42' so you can associate all the values with the single variable name.
Attachments (1)
Change History (5)
Changed 15 years ago by
Attachment: | dojo.io.encodeForm.20060521.patch added |
---|
comment:2 Changed 15 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
Yep, a quick look at some raw POST data verifies that I was totally talking through my hat. The current encodeForm has got it right. I should have done my homework better.
comment:3 Changed 15 years ago by
Milestone: | → 0.3.1 |
---|
Patch for encodeForm multi-checkbox issue