Opened 9 years ago

Closed 9 years ago

#10584 closed defect (duplicate)

dojo.query faild

Reported by: milad Owned by: alex
Priority: high Milestone: tbd
Component: Query Version: 1.4.0
Keywords: Cc:
Blocked By: Blocking:

Description

hi all, i have:

<input name="test[]" dojoType="dijit.form.ValidationTextBox" type="text">

when i run:

console.log(dojo.query('input[name=test[]]').length);

print 0 on console!,but with this command:

console.log(dojo.query('input[name^=test[]]').length);

print 1 on console. same action in 1.4 & 1.3.2

Attachments (1)

query.html (890 bytes) - added by milad 9 years ago.

Download all attachments as: .zip

Change History (3)

Changed 9 years ago by milad

Attachment: query.html added

comment:1 Changed 9 years ago by Les

This will work if you escape [ and ], like this:

dojo.query('input[name=test\\[\\]]')

For comparison, jQuery works w/o escaping.

comment:2 Changed 9 years ago by James Burke

Resolution: duplicate
Status: newclosed

This specific example works with the backslash escaping, but the one in #11189 is not working, so closing this bug in favor of that one. Removing the backslash requirement is not likely to change for Dojo 1.x.

Note: See TracTickets for help on using tickets.