back to referring page

M

Mike Brearley

I was wondering if there was an easy way to have a form set up so that when
the submit button is pressed, it goes to a confirmation page that contains a
back button that goes back to the page that called the form.

Basically, I'm looking at a scenario where 10 pages can call the form, but I
want to user to be able to click the back button and be returned to the page
they were on when they click on the link to the form.

I thought that maybe using javascript:history.go(-2) would work, but if the
form is reloaded for any reason, gaing back 2 pages goes back to the form.

--
Posted 'as is'. If there are any spelling and/or grammar mistakes, they
were a direct result of my fingers and brain not being synchronized or my
lack of caffeine.

Mike Brearley
 
A

Aaron Bertrand - MVP

Why not make the referring URL part of the form data.

<form name=a onsubmit='document.a.referer.value=document.location.href';>
<input type=hidden name=referer>
....

Then on the next page,

<input type=button onclick='location.href="<%=request.form("referer")%>";'>
 
M

Mike Brearley

what about calling the form page with something like
'form.asp?referer=thispage.htm' Question is, how do I find out what referer
is and use it or what's the correct way of doing this?

--
Posted 'as is'. If there are any spelling and/or grammar mistakes, they
were a direct result of my fingers and brain not being synchronized or my
lack of caffeine.

Mike Brearley
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,148
Messages
2,570,838
Members
47,385
Latest member
Joneswilliam01

Latest Threads

Top