Myreader.co.uk  
uk news, chat and community
   home   |   control panel login   |   archive   |  
 
net
net
news.announce
news.config
news.management
news.moderation
providers
providers.aaisp
web.authoring
  
 
date: Tue, 12 Aug 2008 11:18:41 GMT,    group: uk.net.web.authoring        back       
Returning from a form   
If a form can be called from several different pages on a site, how do you
get back from the "thank you" success message to the page that the form was
called from?

(a) Open the form and the "thank you" message in a new window so it can
simply be closed.  This seems to me to be the obvious way but is supposed to
be very naughty & of course is not supported in strict HTML 4.  (I suppose,
on the principle of "find out what little Johnny is doing, and stop him.")
Of course real users are not to be denied something so useful, so they use
Javascript.  But increasing numbers of people seem to have blocked it.  I
suppose if you use JS you could put up a message for non-script users
explaining that they will have to use the back button twice, but it seems a
but clunky.

(b) Repeat the full navigation on the "thank you" page so users can get back
to where they came from, if they can remember where it was.

(c) (I've not seen this but it seems possible.) Have a different form page
for each calling page, with a hidden field saying where it was called from.
This can be checked to send a "thank you" message with the appropriate
"back" button. For ease of maintenance, most of the form page could be
includes, with only the different bit being directly called.

I'm sure I've missed something obvious but what is it?

-- 
Tony W
My e-mail address has no hyphen
- but please don't use it, reply to the group.
date: Tue, 12 Aug 2008 11:18:41 GMT   author:   Tony

Re: Returning from a form   
"Tony"  writes:
> If a form can be called from several different pages on a site, how do you
> get back from the "thank you" success message to the page that the form was
> called from?
>
> (c) (I've not seen this but it seems possible.) Have a different form page
> for each calling page, with a hidden field saying where it was called from.
> This can be checked to send a "thank you" message with the appropriate
> "back" button. For ease of maintenance, most of the form page could be
> includes, with only the different bit being directly called.

This would work (although make sure that the hidden field doesn't say
directly where it was called from - send an ID number instead that the
thankyou page can translate) but it's a bit inefficient.

More efficient would be to have each calling page have a reference to
itself in the link to the form page.
--on page 370--
<a href='/form?src=370'>Complete the form</a>

The form can then (after checking that the numeric ID is valid) put
that into a hidden field, and the thankyou page can (again after
checking) put the link back.

If your pages don't already have suitable numeric IDs, then a small
database table (or even a file, if there's very few of them) can
contain this information (which for now only needs to be added for
pages that might link to the form)

Alternatively, depending on how your site is set up, the form could
use the calling page as the action for the form, and the calling page
could display a thankyou message at the top and process the form if
the POST data is there, and just work normally otherwise.

-- 
Chris
date: 12 Aug 2008 12:30:17 +0100   author:   Chris Morris

Re: Returning from a form   
"Tony"  wrote...
> If a form can be called from several different pages on a site, how do you
> get back from the "thank you" success message to the page that the form 
> was
> called from?
>
> (a) Open the form and the "thank you" message in a new window so it can
> simply be closed.  This seems to me to be the obvious way but is supposed 
> to
> be very naughty & of course is not supported in strict HTML 4.  (I 
> suppose,
> on the principle of "find out what little Johnny is doing, and stop him.")
> Of course real users are not to be denied something so useful, so they use
> Javascript.  But increasing numbers of people seem to have blocked it.  I
> suppose if you use JS you could put up a message for non-script users
> explaining that they will have to use the back button twice, but it seems 
> a
> but clunky.

The simple method would be a 'continue' button holding back-2 pages JS 
wouldn't it. Depends on how concerned you are about JS blocking users *In 
This Scenario*. I'm sure they'd be used to little inconvineces like hitting 
the back button or <- key twice if they are going to go browsing blocking.

You can't expect a Rolls Royce ride if you take the suspension out.

>
> (b) Repeat the full navigation on the "thank you" page so users can get 
> back
> to where they came from, if they can remember where it was.
>
> (c) (I've not seen this but it seems possible.) Have a different form page
> for each calling page, with a hidden field saying where it was called 
> from.
> This can be checked to send a "thank you" message with the appropriate
> "back" button. For ease of maintenance, most of the form page could be
> includes, with only the different bit being directly called.
>
> I'm sure I've missed something obvious but what is it?

Pass.

-dE|_---
date: Tue, 12 Aug 2008 12:52:28 +0100   author:   dE|_

Re: Returning from a form   
Message-ID:  from Chris Morris
contained the following:

>Alternatively, depending on how your site is set up, the form could
>use the calling page as the action for the form, and the calling page
>could display a thankyou message at the top and process the form if
>the POST data is there, and just work normally otherwise.

In the past, with PHP,  I have also stored the referring page in a
session variable and used that to dynamically generate a back button[1].
But I rather think the OP may be looking for non-scripting solutions.
If this is the case, then separate forms and thank you pages may be the
easiest option. 


[1] I usually get the referring page info from $_SERVER['HTTP_REFERER']
I know it can be spoofed but this exercise serves no real functional
purpose, it's just a nice thing to do for the user.

Something like this:

On the top of the form page
<?php
session_start();
$_SESSION['referring_page']=$_SERVER['HTTP_REFERER'] ;
?>

On the top of the thank you page
<?php
session_start();
$back_button=$_SESSION['referring_page'];
?> 


then in the document where you want the back button to be

<?php
if(!empty($back_button)){
echo "<a href='$back_button'>Back</a>";
}
else{
//echo an alternative link in case something has gone wrong
}
unset($_SESSION['referring_page']);
?>

Server needs to be PHP enabled and files should end in .php of course.
-- 
Geoff Berrow  0110001001101100010000000110
001101101011011001000110111101100111001011
100110001101101111001011100111010101101011
http://slipperyhill.co.uk
date: Tue, 12 Aug 2008 13:18:19 +0100   author:   Geoff Berrow

Re: Returning from a form   
Message-ID: <YPeok.691$Xm4.318@newsfe13.ams2> from dE|_ contained the
following:

>The simple method would be a 'continue' button holding back-2 pages JS 
>wouldn't it. Depends on how concerned you are about JS blocking users *In 
>This Scenario*. I'm sure they'd be used to little inconvineces like hitting 
>the back button or <- key twice if they are going to go browsing blocking.
>
>You can't expect a Rolls Royce ride if you take the suspension out.

While I'd agree that this comes under the category of  'convenient not
essential' that is usually served by a bit of Javascript, in this case
it's not massively complex to avoid it.

-- 
Geoff Berrow  0110001001101100010000000110
001101101011011001000110111101100111001011
100110001101101111001011100111010101101011
http://slipperyhill.co.uk
date: Tue, 12 Aug 2008 13:23:20 +0100   author:   Geoff Berrow

Re: Returning from a form   
Thanks to all for very fast responses.  I'll try Geoff's script solution 
first, as there has to be script to handle the form anyway and it seems 
quite elegant.

-- 
Tony W
My e-mail address has no hyphen
- but please don't use it, reply to the group.
date: Tue, 12 Aug 2008 21:02:04 GMT   author:   Tony

Re: Returning from a form   
"Geoff Berrow"  wrote in message 
news:30v2a4hcej6fsn39uh7gkrqik68hmofe3u@4ax.com...
> On the top of the form page
> <?php
> session_start();
> $_SESSION['referring_page']=$_SERVER['HTTP_REFERER'] ;
> ?>
etcetera

Just thought I would say, thanks it works fine.

-- 
Tony W
My e-mail address has no hyphen
- but please don't use it, reply to the group.
date: Fri, 15 Aug 2008 22:39:21 GMT   author:   Tony

Re: Returning from a form   
Message-ID: <tAnpk.43375$E41.26444@text.news.virginmedia.com> from Tony
contained the following:

>
>Just thought I would say, thanks it works fine.

Cool :-)

-- 
Geoff Berrow  0110001001101100010000000110
001101101011011001000110111101100111001011
100110001101101111001011100111010101101011
http://slipperyhill.co.uk - http://4theweb.co.uk
date: Sat, 16 Aug 2008 01:05:59 +0100   author:   Geoff Berrow

Google
 
Web myreader.co.uk


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us