Bug Tracker

Ticket #3685 (closed bug: fixed)

Opened 6 years ago

Last modified 3 years ago

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
Blocking: Blocked by:

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

comment:1 Changed 6 years ago by flesler

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

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 6 years ago by dmethvin

  • Keywords form added

Possibly related to #3806

comment:3 Changed 4 years ago by jitter

#7712 is a duplicate of this ticket.

comment:4 Changed 4 years ago by jitter

  • Component changed from core to manipulation
  • Priority changed from major to blocker
  • Owner flesler deleted
  • Version changed from 1.2.6 to 1.4.4
  • Milestone changed from 1.3 to 1.5
  • Keywords expando added

comment:5 Changed 4 years ago by jitter

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

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

comment:6 Changed 4 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 4 years ago by rwaldron

  • Cc rwaldron added

comment:8 Changed 4 years ago by rwaldron

#4652 is a duplicate of this ticket.

comment:9 Changed 4 years ago by timmywil

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