Ticket #9990 (closed bug: duplicate)
Value for required attribute FireFox 3.6 with JQuery 1.6.2 is undefined
| Reported by: | mavis0710 | Owned by: | |
|---|---|---|---|
| Priority: | undecided | Milestone: | None |
| Component: | unfiled | Version: | 1.6.2 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
Reproduce by using: 1.5.2 http://jsfiddle.net/E6vUQ/ 1.6.2 http://jsfiddle.net/r9vFs/
OR Test page <html xmlns=" http://www.w3.org/1999/xhtml"> <head> <title>Test required initial value</title> <meta http-equiv="Pragma" content="no-cache" /> <meta http-equiv="Expires" content="-1" /> <script language="JavaScript" type="text/javascript" src=" http://localhost/jquery.js"></script> <script language="javascript" type="text/javascript">
$(document).ready(function () {
var testRequired = $('input#testRequired'); alert('Required: ' + testRequired.attr('required'));
});
</script> </head>
<body>
<input type="text" id="testRequired" value="test value" required="true"> </body> </html>
The attr function returns undefined instead of true
Change History
comment:2 Changed 22 months ago by jonbergan
Just double checked this in Chrome and a few other browsers and they seem to be operating fine. Definitely a Firefox 3.6.x issue.
Thanks.
Jon
comment:3 Changed 22 months ago by dflor003
I am seeing this in Firefox 3.6 as well. The behavior is not consistent with what happens in IE7, IE8, and Chrome. Have not had a chance to test it with other browsers.
Would definitely like to see this fixed in 1.6.3
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

Just noticed this issue in Firefox 3.6.19 also. This code was working fine on 1.4.2 as far as I can recall, however since upgrading to 1.6.1 and 1.6.2, the issue has arisen.
I have a form validation class which uses the required="required" attribute in conjunction with $(obj).attr('required') and it's now returning "undefined".
Any ideas when this will be addressed? Looking at releasing this app as a private beta next month. Would love to be running 1.6.2 but will downgrade to 1.4.2 if necessary.
Thanks guys!
Jon