FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » multi-page form
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: multi-page form [message #174688 is a reply to message #174685] Mon, 27 June 2011 22:54 Go to previous messageGo to previous message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma:
Senior Member
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(at)attglobal(dot)net
==================
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to get php5-mbstring where people can use it
Next Topic: Copying data between databases
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 30 15:00:03 GMT 2024

Total time taken to generate the page: 0.04597 seconds