| re: Problem on FIREFOX with "document.form.submit();"
Alex wrote:[color=blue]
> Hello,
>
> I use the following script inside a page. My page contains : 1 FORM,
> Some Hidden fields, and one line of JAVASCRIPT in order to instantly
> post the Form.
> The problem is that under FIREFOX, the JAVASCRIPT line don't seems to
> be correct, because FIREFOX does'nt post the Form... But my[/color]
javascript[color=blue]
> line looks correct to me...
>
> Below is the Script; thanks for your Help in advance.
> Alex.
>
> <form action="my_next_page.html" method="POST" name="form1">
> <input type="hidden" name="hidden_field1" size="40"
> value="some_value1">
> <input type="hidden" name="hidden_field2" size="40"
> value="some_value2">
> </form>
> <!--The following Javascript line doesn't work, but why ?-->
> <script[/color]
language="JavaScript">window.document.form1.submit ();</script>[color=blue]
>
> Thanks... :-)[/color]
Who knows, could be the usual timing error. Try onload instead:
<html>
<head>
<script type="text/javascript">
window.onload = function()
{
document.forms[0].submit();
}
</script>
</head>
<body>
..........
.......... |