javascript - submit a form without using a submit button -
i trying submit without using submit button. here have used javascript , once form has submitted user should directed b.php.
html code
<form id="jsform" action="b.php" method="post" target="_blank"> <input type="hidden" value="test" name="title"/> </form>
java-script code
<script type="text/javascript"> document.getelementbyid('jsform').submit(); </script>
these 2 code lines run separately not running together. mistakes have done.
in javascript can this:
window.onload=function() { document.getelementbyid("jsform").submit(); // using id }
and jquery
$(function() { $("#jsform").submit(); // using id });
Comments
Post a Comment