Opened 12 years ago
Closed 6 years ago
#8619 closed defect (fixed)
CheckBox: get("value") return code is strange
Reported by: | frostmourn | Owned by: | |
---|---|---|---|
Priority: | high | Milestone: | 2.0 |
Component: | Dijit - Form | Version: | 1.2.3 |
Keywords: | Checkbox | Cc: | |
Blocked By: | Blocking: |
Description
I use dijit.form.CheckBox? getValue method and found it is strange.When the checkbox is checked, getValue method returns "on" , and when it is not checked, it returns false. I think it's not a good design.By the way , when I use this code:
var value = dojo.byId("checkboxID").value;
or
var value = dojo.byId("checkboxID").checked;
the value is undefined. It's not convenient for users.
Change History (7)
comment:1 Changed 12 years ago by
Milestone: | tbd → 2.0 |
---|---|
Summary: | the checkbox getValue method → CheckBox: getValue() method return code is strange |
comment:2 Changed 12 years ago by
An added design point was the need for widget.attr('value', widget.attr('value')) to work.
comment:3 Changed 10 years ago by
Component: | Dijit → Dijit - Form |
---|---|
Owner: | set to Douglas Hays |
comment:4 Changed 8 years ago by
Summary: | CheckBox: getValue() method return code is strange → CheckBox: get("value") return code is strange |
---|
comment:5 Changed 7 years ago by
Owner: | Douglas Hays deleted |
---|---|
Status: | new → assigned |
comment:6 Changed 7 years ago by
Status: | assigned → open |
---|
comment:7 Changed 6 years ago by
Resolution: | → fixed |
---|---|
Status: | open → closed |
Marking this as fixed in 2.0 because https://github.com/ibm-js/deliteful/blob/master/Checkbox.js doesn't have that goofy code conflating the checked
and value
attributes.
Note: See
TracTickets for help on using
tickets.
Yes, the current behavior is the compromise of a long discussion... the issue is that:
I can't think of any way to change this that would make it "better" in most people's eyes, except maybe returning null or "" rather than false. What change did you have in mind?