Opened 11 years ago

Closed 11 years ago

Last modified 9 years ago

#8016 closed defect (fixed)

[REGRESSION] brackets in RadioButton's name breaks them

Reported by: regilero Owned by: Douglas Hays
Priority: high Milestone: 1.3
Component: Dijit - Form Version: 1.2.0
Keywords: radiobutton regression brackets Cc:
Blocked By: Blocking:

Description

using radioButton with a name like "foo[bar]" makes thems unsuable. When you select a radio check he is seleced but previous entries aren't unchecked. And you cannot uncheck any checked entry. This was working with 1.1.0.

The bug is in the new _setCheckedAttr: in dijit/form/Checkbox.js

line 129:

dojo.query('INPUT[type=radio][name='+this.name+']', this.focusNode.form||dojo.doc).forEach(

this.name cannot be a name containg brackets. I found a workaround by reading ticket #6834. Changing the line to handle the possibility of having brackets in the name (which is very important for me, my names are foo[bar][toto][titi] and I do not want to break this):

dojo.query("INPUT[type=radio][name^='"+this.name+"']",this.focusNode.form||dojo.doc).forEach(

Change History (9)

comment:1 Changed 11 years ago by Douglas Hays

Owner: set to Douglas Hays

comment:2 Changed 11 years ago by Douglas Hays

comment:3 Changed 11 years ago by Douglas Hays

Milestone: tbd1.3

Adding the begins-with () operator as suggested seems incorrect.

comment:4 in reply to:  3 Changed 11 years ago by Douglas Hays

Replying to doughays:

Adding the begins-with (\) operator as suggested seems incorrect.

comment:5 Changed 11 years ago by Douglas Hays

Resolution: fixed
Status: newclosed

[15593] Fixes #8016. Adding quotes around name value.

comment:6 Changed 11 years ago by Jens Kleikamp

The bug described in this ticket still needs to be fixed in current trunk.

comment:7 Changed 11 years ago by Jens Kleikamp

Resolution: fixed
Status: closedreopened

comment:8 Changed 11 years ago by Douglas Hays

Resolution: fixed
Status: reopenedclosed

[16657] Fixes #8016. dojo.query does not support [name='val[1]'], so use name= instead and then manually compare all the returned elements for the correct name.

comment:9 Changed 9 years ago by bill

Component: DijitDijit - Form
Note: See TracTickets for help on using tickets.