Bug Tracker

Opened 8 years ago

Closed 6 years ago

Last modified 5 years ago

#3685 closed bug (fixed)

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: Rick Waldron
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>

Change History (9)

comment:1 Changed 8 years ago by flesler

Cc: graymeat added
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.

comment:2 Changed 8 years ago by dmethvin

Keywords: form added

Possibly related to #3806

comment:3 Changed 6 years ago by jitter

#7712 is a duplicate of this ticket.

comment:4 Changed 6 years ago by jitter

Component: coremanipulation
Keywords: expando added
Milestone: 1.31.5
Owner: flesler deleted
Priority: majorblocker
Version: 1.2.61.4.4

comment:5 Changed 6 years ago by jitter

Cc: graymeat removed
Component: manipulationselector
Status: assignedopen

test case by rwaldorn from #7712
test case based on reporters code

comment:6 Changed 6 years ago by john

Milestone: 1.51.6

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

comment:7 Changed 6 years ago by Rick Waldron

Cc: Rick Waldron added

comment:8 Changed 6 years ago by Rick Waldron

#4652 is a duplicate of this ticket.

comment:9 Changed 6 years ago by timmywil

Resolution: fixed
Status: openclosed
Note: See TracTickets for help on using tickets.