I am trying to submit a form via jquery. I want my form submit object to be launched when jquery submits the form.
But when the form is submitted successfully, submitting the event handler is not successful.
Below is the code:
<html> <head> <title>forms</title> <script src="../common/jquery-1.6.2.min.js"></script> <script> $('#testform').submit(function() { $.post($(this).attr("action"), $(this).serialize(), function(html) { $("#menu").html('<object>'+html+'</object>'); }); return false; </script> </head> <body> <form id="testform" action="<%=getURL%>" method="post" > <input type="hidden" value="test" name=otherParams> </form> <script language=javascript> $('#testform').submit(); </script> <div id="menu" style="position:relative; bottom: 0; overflow:hidden;"> </div> </body>
I searched all forums, but could not get permission.
source share