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 #174697 is a reply to message #174685] Tue, 28 June 2011 18:57 Go to previous messageGo to previous message
Peter H. Coffin is currently offline  Peter H. Coffin
Messages: 245
Registered: September 2010
Karma:
Senior Member
On Mon, 27 Jun 2011 18:01:21 -0400, William Gill wrote:
> 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.

If the circumstance you're concerned about is (for example) a 3-page
form, a user being on page 2, entering data in a few fields, flipping
back to page one, flipping forward to page 2 again and the concern is
about whether the previous page-2 fields still have the entered data or
not, don't worry about it. It's all under the brower's control anyway.
If the user uses the page-forward button, the entered data will
*probably* still be there, but there's nothing you can do to control it
either way. If the user uses the "next page"/html submit button to go
forward, the entered data will probably *not* be there, but in this
case, you *still* can't do anything about it. And we're not even getting
into the whole molassas vat of what happens if the user changes
something and then uses those two different means of navigation...

Even the use of the javascript events doesn't necessarily fix the
behavior to one thing or the other, as web pages are *supposed to be*
fairly agnostic as to user agent. Not all user agents have javascript,
not all have it turned on, not all have complete implementations of
those events even if they do. (EG: some versions of Firefox trigger
..unload on a tab close, and trigger .load on a tab restore. Some don't.)

Short answer: PHP can't make a browser into a complex client interface
engine. It just won't work. Can't make a silk purse out of a pig's ear
either.

--
29. I will dress in bright and cheery colors, and so throw my enemies
into confusion.
--Peter Anspach's list of things to do as an Evil Overlord
[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 07:07:09 GMT 2024

Total time taken to generate the page: 0.04799 seconds