Skip to main content

Bug Tracker

Side navigation

#3685 closed bug (fixed)

Opened December 05, 2008 12:33AM UTC

Closed April 10, 2011 07:58PM UTC

Last modified March 09, 2012 08:30AM UTC

Selector fails for forms with an element named "name"

Reported by: graymeat Owned by:
Priority: blocker Milestone: 1.6
Component: selector Version: 1.4.4
Keywords: form expando Cc: rwaldron
Blocked by: Blocking:
Description

Compare the results of the following two examples.

The first example displays an alert box with the name of the form. (Expected behavior.)

The second example displays an alert box with "undefined".

This is on Firefox 3.0.4.

<html>
<head>
<script src="javascript/jquery-1.2.6.js"></script>
</head>
<body>
<a href="#">test</a>
<form name="testform">
<input type="text" name="aname" value="" />
</form>
<script>

$("a").click(function()
{
	var form = $("form[name=testform]");
	alert(form.attr("name"));
});
</script>
</body>
</html>
<html>
<head>
<script src="javascript/jquery-1.2.6.js"></script>
</head>
<body>
<a href="#">test</a>
<form name="testform">
<input type="text" name="name" value="" />
</form>
<script>

$("a").click(function()
{
	var form = $("form[name=testform]");
	alert(form.attr("name"));
});
</script>
</body>
</html>
Attachments (0)
Change History (9)

Changed December 06, 2008 12:17AM UTC by flesler comment:1

cc: → graymeat
component: unfilledcore
status: newassigned

I'm not sure whether this is already fixed on trunk, I think we had a patch but added too much overhead.

I'll take a look asap.

Changed January 18, 2009 01:59AM UTC by dmethvin comment:2

keywords: → form

Possibly related to #3806

Changed December 06, 2010 03:52PM UTC by jitter comment:3

#7712 is a duplicate of this ticket.

Changed December 06, 2010 03:54PM UTC by jitter comment:4

component: coremanipulation
keywords: formform expando
milestone: 1.31.5
owner: flesler
priority: majorblocker
version: 1.2.61.4.4

Changed December 14, 2010 05:16PM UTC by jitter comment:5

cc: graymeat
component: manipulationselector
status: assignedopen

test case by rwaldorn from #7712\\\\

test case based on reporters code

Changed January 17, 2011 04:54PM UTC by john comment:6

milestone: 1.51.6

This is getting moved to 1.6 for when the $.attr happens.

Changed March 21, 2011 03:40PM UTC by rwaldron comment:7

cc: → rwaldron

Changed April 02, 2011 12:44AM UTC by rwaldron comment:8

#4652 is a duplicate of this ticket.

Changed April 10, 2011 07:58PM UTC by timmywil comment:9

resolution: → fixed
status: openclosed