Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #2364

Re: multi-page form

From Jerry Stuckle <jstucklex@attglobal.net>
Newsgroups comp.lang.php
Subject Re: multi-page form
Date 2011-06-27 18:54 -0400
Organization A noiseless patient Spider
Message-ID <iub1ml$55u$1@dont-email.me> (permalink)
References <iuabqa$530$1@dont-email.me> <iuasu2$6lc$1@dont-email.me> <iuaujv$c7t$1@dont-email.me>

Show all headers | View raw


On 6/27/2011 6:01 PM, William Gill wrote:
> On 6/27/2011 5:32 PM, Jerry Stuckle wrote:
>> On 6/27/2011 12:40 PM, William Gill wrote:
>>> I am working on a form that will traverse many pages (lots of context
>>> and a few inputs on each page). My concern is the user navigating back
>>> and forth between pages w/o losing data (i.e. via the back button).
>>>
>>> As far as I can tell, I need to integrate ECMA script, XMLHttpRequest,
>>> and session variables, triggered by the onLoad and onUnload events.
>>>
>>> Are there any other approaches that I should look into?
>>
>> What are you trying to do? Keep the user from going back a page? If they
>> do, the client may not even request the page from the server - just
>> serve it from the client cache.
>>
>> Do you want to prevent the user from going back a page? Force the page
>> to be reloaded if they do go back? What's your goal?
>>
> No I wouldn't prevent them from going back and forth even if I could.
>
> There are as few as 4 or 5 fields on some pages, but they may need/want
> to back up to see their earlier input.
>
> All I want is to prevent them from completing some fields; then backing
> up and losing their input.
>
> I'm thinking of creating an XMLHttpRequest object and using it to update
> session variables if a user backs up (triggered by the ONUNLOAD
> event),and then repopulating the fields when he/she returns (ONLOAD).
>
> Haven't done it in a while, and wanted to know if this is the best
> approach.
>

 From the PHP end, it's not that hard.  When they enter data, place it 
in the $_SESSION array.  When you display a page, check to see if the 
entries have already been saved in the $_SESSION array.  If they have, 
display the previously entered values.  If not, display an empty field 
or other default value.

If you want to use AJAX or other javascript code, you're asking in the 
wrong newsgroup.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

multi-page form William Gill <noreply@domain.invalid> - 2011-06-27 12:40 -0400
  Re: multi-page form Bill B <me@privacy.net> - 2011-06-27 13:31 -0400
    Re: multi-page form William Gill <noreply@domain.invalid> - 2011-06-27 13:41 -0400
      Re: multi-page form Bill B <me@privacy.net> - 2011-06-27 14:24 -0400
  Re: multi-page form Jerry Stuckle <jstucklex@attglobal.net> - 2011-06-27 17:32 -0400
    Re: multi-page form William Gill <nospam@domain.invalid> - 2011-06-27 18:01 -0400
      Re: multi-page form Bill B <me@privacy.net> - 2011-06-27 18:18 -0400
        Re: multi-page form Graham Hobbs <ghobbs@cdpwise.net> - 2011-07-05 20:06 -0400
      Re: multi-page form Jerry Stuckle <jstucklex@attglobal.net> - 2011-06-27 18:54 -0400
        Re: multi-page form William Gill <nospam@domain.invalid> - 2011-06-28 04:22 -0400
          Re: multi-page form Jerry Stuckle <jstucklex@attglobal.net> - 2011-06-28 06:53 -0400
            Re: multi-page form William Gill <nospam@domain.invalid> - 2011-06-28 12:13 -0400
              Re: multi-page form Bill B <me@privacy.net> - 2011-06-28 14:00 -0400
                Re: multi-page form Jerry Stuckle <jstucklex@attglobal.net> - 2011-06-28 15:02 -0400
                Re: multi-page form Bill B <me@privacy.net> - 2011-06-28 15:06 -0400
                Re: multi-page form Bill B <me@privacy.net> - 2011-06-28 15:46 -0400
                Re: multi-page form William Gill <nospam@domain.invalid> - 2011-06-28 16:05 -0400
                Re: multi-page form Bill B <me@privacy.net> - 2011-06-28 16:12 -0400
                Re: multi-page form Bill B <me@privacy.net> - 2011-06-28 16:20 -0400
                Re: multi-page form Jerry Stuckle <jstucklex@attglobal.net> - 2011-06-28 18:58 -0400
                Re: multi-page form Jeff North <jnorthau@yahoo.com.au> - 2011-06-29 09:30 +1000
                Re: multi-page form Jerry Stuckle <jstucklex@attglobal.net> - 2011-06-28 20:21 -0400
                Re: multi-page form Jeff North <jnorthau@yahoo.com.au> - 2011-06-29 14:52 +1000
                Re: multi-page form Jerry Stuckle <jstucklex@attglobal.net> - 2011-06-29 07:59 -0400
                Re: multi-page form Bill B <me@privacy.net> - 2011-06-29 08:09 -0400
                Re: multi-page form Jerry Stuckle <jstucklex@attglobal.net> - 2011-06-29 08:41 -0400
                Re: multi-page form Bill B <me@privacy.net> - 2011-06-29 08:48 -0400
                Re: multi-page form Jerry Stuckle <jstucklex@attglobal.net> - 2011-06-29 11:08 -0400
                Re: multi-page form Bill B <me@privacy.net> - 2011-06-29 12:27 -0400
                Re: multi-page form Jeff North <jnorthau@yahoo.com.au> - 2011-06-29 23:10 +1000
                Re: multi-page form Jerry Stuckle <jstucklex@attglobal.net> - 2011-06-29 11:09 -0400
                Re: multi-page form Michael Fesser <netizen@gmx.de> - 2011-06-29 18:56 +0200
                Re: multi-page form Jerry Stuckle <jstucklex@attglobal.net> - 2011-06-29 15:32 -0400
      Re: multi-page form "Peter H. Coffin" <hellsop@ninehells.com> - 2011-06-28 13:57 -0500
  Re: multi-page form Jeff North <jnorthau@yahoo.com.au> - 2011-06-29 08:46 +1000
    Re: multi-page form William Gill <nospam@domain.invalid> - 2011-06-28 19:29 -0400
      Re: multi-page form Jeff North <jnorthau@yahoo.com.au> - 2011-06-29 15:15 +1000
        Re: multi-page form Jerry Stuckle <jstucklex@attglobal.net> - 2011-06-29 08:01 -0400
        Re: multi-page form Michael Fesser <netizen@gmx.de> - 2011-06-29 19:00 +0200
  Re: multi-page form Michael Fesser <netizen@gmx.de> - 2011-06-29 19:05 +0200
    Re: multi-page form William Gill <nospam@domain.invalid> - 2011-06-29 13:44 -0400

csiph-web