Automatically submit a form using javascript

<form id="myForm" name="myForm" action="http://example.com/examplePage.do" method="POST">
<input type=text name="val1" id="val1" value="value1"/>
<input type=text name="val2" id="val2" value="value2"/>
<input type=text name="val3" id="val3" value="value3"/>
<input type=text name="submit" id="submit" value="Continue"/>
</form>

<html>
<body onload="document.createElement('form').submit.call(document.getElementById('myForm'))">
<form id="myForm" name="myForm" action="http://example.com/examplePage.do" method="POST">
<input type=hidden name="val1" id="val1" value="value1"/>
<input type=hidden name="val2" id="val2" value="value2"/>
<input type=hidden name="val3" id="val3" value="value3"/>
<input type=hidden name="submit" id="submit" value="Continue"/>
</form>
</body>
</html>

No comments:

Post a Comment