#6834 closed defect (fixed)
Square brackets handled improperly in dojo attribute queries
Reported by: | guest | Owned by: | |
---|---|---|---|
Priority: | low | Milestone: | 1.3 |
Component: | Query | Version: | 1.1.1 |
Keywords: | query attribute | Cc: | |
Blocked By: | Blocking: |
Description
Browser: Firefox 2.0.0.14 OS: Mac OS X 10.5.2
I was unable to find any mention of this elsewhere, so I have to assume it's a bug. I apologize if it's already been addressed and I'm wasting someone's time.
I have a bunch of checkboxes (with dojoType="dijit.form.CheckBox?") all named 'unitType[]' (the square brackets at the end cause PHP to treat the collection of them as one array). I've tried doing the following queries for them:
var foo = dojo.query("input[name='unitType[]']"); var foo = dojo.query("input[name='unitType\[\]']"); var foo = dojo.query("input[name='unitType']");
None of these find the checkboxes. I am positive these elements exist, with the name unitType[], and I tried it with a few other square-bracket-names with the same result.
I believe the problem is related to it incorrectly parsing square brackets. When I did each of the following queries:
dojo.query("input[name^='unitType[]']"); dojo.query("input[name^='unitType\[\]']");
It finds them, as well as the checkbox named "unitTypeCkAll" (which it shouldn't find, because 'unitTypeCkAll' does not start with 'unitType[]'). This sounds to me like it's ignoring the square brackets entirely.
Change History (4)
comment:1 Changed 13 years ago by
Milestone: | → future |
---|
comment:2 Changed 10 years ago by
Owner: | anonymous deleted |
---|
comment:3 Changed 9 years ago by
Milestone: | future → 1.3 |
---|---|
Priority: | high → low |
Resolution: | → fixed |
Status: | new → closed |
comment:4 Changed 9 years ago by
Component: | Core → Query |
---|
fixed sometime before 1.3 - http://jsfiddle.net/dZhZn/