Here is my code:
<body onload="ccform.submit();">
<form id="ccform" name="ccform" method="post" action="https://www.XXXX.com" runat="server">
<input type="hidden" name="id" value="XXX" />
.....
</form>
this works fine both on ie9 and chrome, but in the firefox, it stopped at the this page instead of posting to “https://www.XXXX.com”.
then i changed the code to
<body>
<form id="ccform" name="ccform" method="post" action="https://www.XXXX.com" runat="server">
<input type="hidden" name="id" value="XXX" />
.....
</form>
<script type="text/javascript">
document.body.onload = ccform.submit();
</script>
it still worked on ie9 and chrome but not firefox. Does anyone know why? thanks
I agree with bfavaretto that it is strange to submit on page load.
If you want to submit when the document is ready, you can use jquery :
load jquery :
and then post your form