Opened 11 years ago
Last modified 4 years ago
#9962 open enhancement
Form: return scalar for single checkbox
Reported by: | bill | Owned by: | |
---|---|---|---|
Priority: | high | Milestone: | 1.15 |
Component: | Dijit - Form | Version: | 1.3.2 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
Currently the form widget always treats checkboxes as arrays, even when there's only a single checkbox. For example, in a form like:
<form dojoType=dijit.form.Form> <dojoType=dijit.form.Checkbox name=myCheckbox> </form>
Then Form.getValue() will return {myCheckbox: ["on"]}
or {myCheckbox: []}
rather than the simpler {myCheckbox: "on"}
or {}
.
See also the code added for #8426. Checkboxes have a special code path but maybe after this change they can share the code for that ticket.
Attachments (2)
Change History (8)
comment:1 Changed 10 years ago by
Component: | Dijit → Dijit - Form |
---|---|
Owner: | set to Douglas Hays |
Changed 7 years ago by
Attachment: | _FormMixin.patch added |
---|
comment:2 Changed 7 years ago by
For the form in the ticket description, Form.getValue() will return {myCheckbox: "on"}
or {myCheckBox: null}
.
comment:3 Changed 7 years ago by
Owner: | Douglas Hays deleted |
---|---|
Status: | new → assigned |
comment:4 Changed 7 years ago by
Status: | assigned → open |
---|
comment:5 Changed 5 years ago by
Milestone: | 2.0 → 1.12 |
---|
Very outdated patch unfortunately, but should probably be considered for 1.12.
comment:6 Changed 4 years ago by
Milestone: | 1.13 → 1.15 |
---|
Ticket planning... move current 1.13 tickets out to 1.15 to make it easier to move tickets into the 1.13 milestone.
patch for dijit/form/_FormMixin.js