Bug Tracker

Opened 8 years ago

Closed 5 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: 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>

Change History (9)

comment:1 Changed 8 years ago by flesler

  • Cc graymeat added
  • Component changed from unfilled to core
  • Status changed from new to assigned

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 changed from core to manipulation
  • Keywords expando added
  • Milestone changed from 1.3 to 1.5
  • Owner flesler deleted
  • Priority changed from major to blocker
  • Version changed from 1.2.6 to 1.4.4

comment:5 Changed 6 years ago by jitter

  • Cc graymeat removed
  • Component changed from manipulation to selector
  • Status changed from assigned to open

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

comment:6 Changed 6 years ago by john

  • Milestone changed from 1.5 to 1.6

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

comment:7 Changed 6 years ago by rwaldron

  • Cc rwaldron added

comment:8 Changed 5 years ago by rwaldron

#4652 is a duplicate of this ticket.

comment:9 Changed 5 years ago by timmywil

  • Resolution set to fixed
  • Status changed from open to closed
Note: See TracTickets for help on using tickets.