Re: OT ??: Form posting without leaving form
| From: | Reginald Alex Mullin | Date: | Tue, 14 Jun 2005 23:07:44 +0000 |
| Subject: | Re: OT ??: Form posting without leaving form | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-216990@lists.php.net to get a copy of this message | ||
Bruce,
You can use JavaScript to automatically post the form after a set time.
For example, you can use the 'SetTimeout' function or the 'onunload' event
handler. You should Google these to get a better understanding of how
they work. Listed below are two very basic examples.
<body onunload="JavaScriptFunction();">
SetTimeout('JavaScriptFunction();', MilliSeconds);
> Kall, Bruce A. wrote:
>> This is perhaps a javascript question....
>>
>> Is there a way to post a form to a url without having a user submit from
>> the form?
>>
>> I have a php web page that is a detailed form with a lot of fields. If
>> the user does some work on this form and let's it sit, their session can
>> time out (I had this happen to the user after it sat for 2 hours).
>> <snip>
>
> Hi Bruce
>
> A non-technical answer - is it not possible to break the form up into
> multiple pages? Each page can have only a few fields, and all you can do
> is store each page's submitted data and then recover what would be a
> partial entry of a large form by going to the last completed "miniform"
> when the user logs back in.
>
> My 2c
>
> Rory
>