Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#994 closed defect (fixed)

Checkbox defaults on

Reported by: richard@… Owned by: bill
Priority: high Milestone:
Component: Widgets Version: 0.3
Keywords: Cc:
Blocked By: Blocking:

Description

When using the checkbox widget, the default value sent when the form is submitted is 'on' whether the default for the checkbox was on or off.

If the checkbox is checked, then unchecked, the correct value (ie. no value) is submitted (ie. the act of unsetting the checkbox forces the value to be correct).

Tested against: 0.3.1 and trunk

Change History (6)

comment:1 Changed 13 years ago by anonymous

Component: GeneralWidgets

comment:2 Changed 13 years ago by bill

Owner: changed from anonymous to bill
Status: newassigned

comment:3 Changed 13 years ago by richard@…

in src/widget/html/dojo.js, if the line:

this.inputNode.checked = this.checked;

is added, the correct behaviour results ie.

postCreate: function(args, frag) {

find any associated label and create a labeleby relationship var label = document.getElementsByTagName("label"); if (label && label[0].htmlFor != undefined) {

label[0].id = (label[0].htmlFor + "label"); dojo.widget.wai.setAttr(this.domNode, "waiState", "labelledby", label[0].id);

} this.inputNode.checked = this.checked;

},

comment:4 Changed 13 years ago by anonymous

Yikes, sorry about that. Trying again:

in in src/widget/html/Checkbox.js, if the line:

this.inputNode.checked = this.checked;

is added, the correct behaviour results ie.

                postCreate: function(args, frag) {
                        // find any associated label and create a labeleby relationship
                        var label = document.getElementsByTagName("label");
                        if (label && label[0].htmlFor != undefined) {
                                label[0].id = (label[0].htmlFor + "label");
                                dojo.widget.wai.setAttr(this.domNode, "waiState", "labelledby", label[0].id);
                        }
                        this.inputNode.checked = this.checked;
                },

comment:5 Changed 13 years ago by bill

Milestone: 0.4
Resolution: fixed
Status: assignedclosed

Fixed in [4445]. (Let me know if it isn't working)

comment:6 Changed 12 years ago by (none)

Milestone: 0.4

Milestone 0.4 deleted

Note: See TracTickets for help on using tickets.