Re: Auto submit
| From: | J!M | Date: | Mon, 11 Sep 0000 15:59:49 +0000 |
| Subject: | Re: Auto submit | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-2808@lists.php.net to get a copy of this message | ||
Hello,
I tried Patrick's example and it choked on the window.setTimeout
line (running IE5.5, YMMV;-), but adding an onLoad line to the
BODY tag works the same:
<html>
<head>
<script language="Javascript">
function go()
{
document.test.submit();
}
</script>
</head>
<body onLoad="javascript:go()">
<form name="test" action="two.html" method=post>
<input type=hidden value="text" name="fname">
</form>
Don't forget to place some meaningful code here in case the
browser doesn't support js!
</body>
</html>
Curious about your planned usage of this ... unless you specifically
need to grab client info via js and pass it to php, you can redirect
more easily via php's header() function. Just my $.02.
Have Fun!
J!M
> an exemple:
>
> <form name="test" action="checkout.php3" method=post>
> <input type=hidden value="text" name="fname">
> </form>
> <script language="Javascript">
> function go()
> {
> document.test.submit();
> }
> window.setTimout("go()",0)
> </script>
>
> Perhpas, it works if you add 'document.' !
>
> Zehnder Patrick
>
> Enrico Comini wrote:
>
> > Hello, I'searching how make a Auto submit of a form without click
> > I try this.
> > Don't run
> >
> > echo"
> > <form name=\"form_cli\" method=post action=checkout.php3>
> >
> > <input type=hidden value=\"".$row["fname"]."\"
> > name=\"fname\">
> >
> > </form>
> >
> > <javascript:form_cli.submit();return>";
> >
> > die();
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
> For additional commands, e-mail: php-db-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>