Side navigation
#7280 closed bug (duplicate)
Opened October 22, 2010 05:42AM UTC
Closed October 22, 2010 06:41AM UTC
Last modified March 15, 2012 12:51PM UTC
use form as selector context will tamper form's id if it contains a input named "id" in chrome
Reported by: | quaff | Owned by: | |
---|---|---|---|
Priority: | high | Milestone: | 1.5 |
Component: | unfiled | Version: | 1.4.3 |
Keywords: | form element name id | Cc: | |
Blocked by: | Blocking: |
Description
<html>
<head>
<title>test</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js" type="text/javascript"></script>
<script>
$(function(){
$('input',$('form'));
alert($('form').attr('id'));
});
</script>
</head>
<body>
<form id="test"><input type="text" name="id"/></form>
</body>
</html>
alert "[object HTMLInputElement]" not "test" in chrome
this works fine in firefox and IE
1.4.2 works fine in chrome
change name to "id2" works fine
Attachments (0)
Change History (4)
Changed October 22, 2010 05:44AM UTC by comment:1
Changed October 22, 2010 06:41AM UTC by comment:2
keywords: | → form element name id |
---|---|
priority: | undecided → high |
resolution: | → duplicate |
status: | new → closed |
This is a duplicate of #7275.
Changed April 19, 2011 08:24AM UTC by comment:4
Thanks a lot for this post. I was able to resolve my issue on similar lines usinfg your suggestion.
http://jsfiddle.net/ELvhk/