I have a simple form on a page and I want to auto submit it when some event occurs.
The test code below tries to submit the form as soon as the page loads, but it fails. Firebug says that "H[G] is not a function". H[G] appears to be "submit".
Am I doing something really obviously stupid?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>test</title>
</head>
<body>
<form action="/test.php" method="post" id="packingform">
<input name="bob" value="1" type="text" />
<input type="submit" name="submit" value="hello" />
</form>
<script type="text/javascript" src="/js/jquery.js"></script>
<script type="text/javascript">
// <![CDATA[
$(document).ready(function()
{
// This line fails with an error and the form is not submitted
$("#packingform").submit();
}
);
// ]]>
</script>
</body>
</html>