Javascript Submit - Works in IE not Firefox

Javascript is not my world! I apologize for what is likely a silly question :slight_smile:

I have a page that must redirect to a new location - after all the form data is collected. The page is written in ASP, and must be submitted by POST to move all the data to a new location.

I setup JavaScript to do the form submit, at the end of the page.
This works 100% in IE! The problem is, Firefox does not do anything. It just sits on the redirect page.

<SCRIPT LANGUAGE="javascript">
<!--
document.forms("form1").submit()
//--></SCRIPT>

Any idea why this doesn’t work in FireFox?
Thanks.

We seem to only have half of what we need here. What does the form look like?

Sorry - I didn’t think it was necessary since it is the JS not working with Firefox. It works absolutely fine with IE.

Here is the form followed by the JavaScript code. Obviously I replaced a few values from the actual form, but essentially this is it.


<form name=“form1” id=“form1” method=“post” action=“https://lets_go_to_some_URL.php”>
<table width=“50%” border=“0” cellspacing=“0” cellpadding=“0”>
<tr>
<td>
<!-- Data Collection –>
<input name=“idvalue” type=“hidden” id=“idvalue” value=“<%=(Response.Write(idvalue))%>” size=“50” />
<input name=“gsMT” type=“hidden” id=“gsMT” value=“<%=(Response.Write(gsMT))%>” size=“50” />
<input name=“success” type=“hidden” id=“success” value=“<%=(Response.Write(success))%>” size=“50” />
<input name=“fail” type=“hidden” id=“fail” value=“<%=(Response.Write(fail))%>” size=“50” />
<input name=“amount” type=“hidden” id=“amount” value=“<%=(Response.Write(amount))%>” size=“50” />
<input name=“email” type=“hidden” id=“email” value=“<%=(Response.Write(email))%>” size=“50” />
<input name=“key” type=“hidden” id=“key” value=“<%=(Response.Write(key))%>” size=“50” /></td>
</form>
<SCRIPT LANGUAGE=“javascript”>
<!–
document.forms(“form1”).submit()
//–></SCRIPT>

Thanks for helping to confirm it wasn’t some other issue.

Change the parenthesis to brackets and you’ll be right.


document.forms["form1"].submit();

That did it :slight_smile:
Thanks for your help - greatly appreciated.