tags:

views:

69

answers:

2

** Rephrased **

Fails on Load in IE


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd&quot;&gt;
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <title>Test</title>
        <script type="text/javascript" src="lib/jquery/jquery-1.3.2.js"></script>
        <script type="text/javascript">            
            $(document).ready(function(){                
                $(document).find('form').attr('id', 'FRM_0');
            });
        </script>
    </head>
    <body>
        <h1>jQuery Dynamic Form</h1>
        <form id="testForm" method="post" action="#" onsubmit="return false;">
            <input type="hidden" name="id" value="" />
        </form>
    </body>
</html>

+2  A: 
$('input[type=hidden][name=id]');

Should get you exactly what you want, and it should work in IE. (If I could see the Javascript code you are using, I might be able to be more helpful.)

Sean Vieira
+1  A: 

This is an issue in jQuery. The only resolution I found so far is by changing 'id' to someother value. Create a ticket http://dev.jquery.com/ticket/6336.

stackoverflow
Message from JQuery: **Don't give your form elements the same names as standard form properties (id, name, action, method, etc.)**Useful link: http://yura.thinkweb2.com/domlint/
stackoverflow
Excellent! Thanks for posting the answer here stackoverflow.
Sean Vieira