Bug Tracker

Modify

Ticket #6600 (closed bug: worksforme)

Opened 3 years ago

Last modified 3 years ago

Jquery - selector not selecting Id's when having periods in IE, even when perios id escaped with \\

Reported by: Jkb Owned by:
Priority: undecided Milestone: 1.4.3
Component: selector Version: 1.4.2
Keywords: selector IE periods Cc:
Blocking: Blocked by:

Description

In IE, The selector for multiple inputs is not working whereas in firefox it is. Below is the html.

<td><input id="contactInfo.shippingAddress.city" name="contactInfo.shippingAddress.city" onchange="needToConfirm = true;" type="text" value="city" maxlength="100"/></td>

If selector is written as $("*[id='contactInfo
.shippingAddress']").val("");

It doesn't work

But if written as $("*[id='contactInfo.shippingAddress']").val(""); - it works..

But jquery documentation says, periods must be escaped with

Reference ->  http://forum.jquery.com/topic/jquery-selector-not-selecting-multiple-checkboxes-ie

Attachments

try2.htm Download (1.3 KB) - added by Jkb 3 years ago.
selector not working when id containing period is escaped

Change History

Changed 3 years ago by Jkb

selector not working when id containing period is escaped

comment:1 Changed 3 years ago by addyosmani

  • Priority set to undecided
  • Status changed from new to closed
  • Resolution set to worksforme

In the above test case, it's not necessary to escape the ID in order to create a selector that can select all of the relevant elements desired. Although a period is present, this can be easily handled using a more advanced selector such as this:  http://jsfiddle.net/65DKY/1/

As you can see, this handles multiple elements without any problem.

Just to confirm as well: Using the correct selector (as provided above) you *can* still escape the periods if needed without any loss in functionality.

 http://jsfiddle.net/65DKY/2/

Closing as this should be resolved now.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.