Bug Tracker

Opened 12 years ago

Closed 10 years ago

Last modified 8 years ago

#2990 closed bug (duplicate)

id starts with filter causes 'z.indexOf is not a function' error for radio button with name 'id'

Reported by: michelled Owned by:
Priority: minor Milestone: 1.3
Component: selector Version: 1.2.6
Keywords: Cc:
Blocked by: Blocking:

Description

Here is the markup and code that causes the error:

<div id="contentwrapper">
  <div id="foo">
    <form>
      <input type="radio" name="id"  />
    </form>
  </div>

  <script type="text/javascript">
    var container = jQuery ("#contentwrapper");
    jQuery ("[id^=fo]", container);
  </script>
</div>

Using a more specific selector such as "div[id^=fo]" works fine. Granted having the value of name being 'id' is not wise but jQuery should likely handle the case.

Change History (6)

comment:1 Changed 12 years ago by flesler

Component: coreselector

What version of jQuery are you using ? If not 1.2.6, then update and recheck please.

Do come back to us after you try.

comment:2 Changed 11 years ago by michelled

I tried this with 1.2.6 and the error still occurs.

comment:3 Changed 11 years ago by t1mmyb

I'm getting this issue with a hidden input field with the name "action". Upgrading to 1.2.6 doesn't solve the issue.

Markup:

<input type="hidden" name="action" value="invite">

comment:4 Changed 10 years ago by dmethvin

Resolution: invalid
Status: newclosed

Duplicate of #3113. Don't use input names that match form properties like length, action, id, name, etc.

comment:5 Changed 10 years ago by dmethvin

Resolution: invalid
Status: closedreopened

comment:6 Changed 10 years ago by dmethvin

Resolution: duplicate
Status: reopenedclosed
Note: See TracTickets for help on using tickets.