473,386 Members | 1,821 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

back to referring page

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
Jul 19 '05 #1
2 2301
Why not make the referring URL part of the form data.

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

Then on the next page,

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

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


"Mike Brearley" <mi*******************@NOSPAMhotmail.com> wrote in message
news:eG**************@TK2MSFTNGP09.phx.gbl...
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

Jul 19 '05 #2
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

"Aaron Bertrand - MVP" <aa***@TRASHaspfaq.com> wrote in message
news:u5**************@TK2MSFTNGP10.phx.gbl...
Why not make the referring URL part of the form data.

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

Then on the next page,

<input type=button onclick='location.href="<%=request.form("referer") %>";'>
--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


"Mike Brearley" <mi*******************@NOSPAMhotmail.com> wrote in message
news:eG**************@TK2MSFTNGP09.phx.gbl...
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


Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Steve Macleod | last post by:
Hi, I am using the following code to initialise a session, depending on whether-or-not the users' log in attempt has been successful. if ($session_ok == "TRUE") { //open the session...
6
by: Rich | last post by:
Am just beginning to use javascript. I have some pages that can be arrived at from more than one other page. Yes, the user can use the back button but I'd like to have a back link at the bottom...
4
by: TG | last post by:
Hi, I have a question concerning redirecting users who have logged in using our login page. Once they have properly filled out the form they should be redirected back to the last page they were...
3
by: George | last post by:
VS.NET 2002\Web\VB I am trying to get the referring URL for one of my pages using this: Request.UrlReferrer.ToString Page 1 has a link to Page 2. I click on the link in Page 1, and go to...
29
by: Tom wilson | last post by:
I can't believe this is such an impossibility... I have an asp.net page. It accepts data through on form fields and includes a submit button. The page loads up and you fill out some stuff. ...
3
by: Dan Sikorsky | last post by:
How can I get the Querystring passed to the Referring Page from its referrer? I don't want the querystring coming to my current page. I want the querystring that came to the referring page, so...
4
by: Ryan | last post by:
Greetings, I would like to know if I can name my main browser window so that I can link back to it from a pop-up window. I know using <A HREF="url" TARGET="name"> will name the new window being...
5
by: Christina | last post by:
I can't seem to find any reference for grabbing the title of the referring page, which I want to use for creating a link. i.e. document.write ("Our thanks to <a href='"+document.referrer+"'>"...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.