Skip to main content

Bug Tracker

Side navigation

#14771 closed bug (duplicate)

Opened February 07, 2014 02:30PM UTC

Closed February 24, 2014 03:21PM UTC

jQuery.closest('form') doesn't work for input-elements with name="nodeType"

Reported by: Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.11.0
Keywords: Cc:
Blocked by: Blocking:

If there is any <input name="nodeType"/> in the DOM, the closest("form") and parents("form") methods doesn't work, i.e. the parent form-element is not found.

Try here:

If you change the name="nodeType" attribute to any other value, then it works.

Attachments (0)
Change History (3)

Changed February 07, 2014 02:41PM UTC by dmethvin comment:1

If there's an easy workaround we can fix it, but I suspect the problem will just crop up somewhere else. Not sure if we can access nodeType when it's been clobbered by a form element name.

Changed February 08, 2014 02:40AM UTC by rvidal comment:2

A similar previous case:

Following that logic, this should be marked invalid, although it's a really nasty corner case.

Changed February 24, 2014 03:21PM UTC by dmethvin comment:3

resolution: → duplicate
status: newclosed

Duplicate of #12318.

I'm going to close this as a duplicate, but if anyone has a magic potion to avoid DOMLint-style bugs like this please let us know.