I have this code, let say it's a.html
<form name="frmSubmit" id="frmSubmit" method="post">
<input type="hidden" name="hdnName" value="user name" />
</form>
<script>
// 1 : start
document.frmSubmit.action = 'b.html';
document.frmSubmit.submit();
// 1 : end
// 2 : start
document.getElementById("frmSubmit").action = 'b.html';
document.getElementById("frmSubmit").submit();
// 2 : end
</script>
Both 1 and 2 are working in IE (IE 8), but not in FF (3.6.10). Firebug gives me the following error:
document.frmSubmit is undefined
How can I fix it?