Improve company productivity with a Business Account.Sign Up

x
?
Solved

need to go back and reload a page with one click

Posted on 2002-07-14
6
Medium Priority
?
152 Views
Last Modified: 2012-06-27
Hi,

I have a coldfusion page with a server side "email this page to a friend" funcion set up on it.
So a user fills in their info and clicks the submit button.
On submit they are redirected to a page that says "your message has been sent" and on this page I have a button that allows them to go back to the "email this page to a friend" page. But when I just send them back all the info that they filled out on the email form is still there - looks tacky.
So what I'd like is to have the page reload as I send them back which would be easy except that the url is generated dynamically and never the same twice. I've been trying to use location.referrer to generate an href link but it seems to be beyond my limited skills.
Thanks for any help.

Jon
0
Comment
Question by:jonleehacker
  • 3
  • 2
6 Comments
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 7152669
Why not use a new window pop-up for the send to friend stuff, that way you wouldn't have to worry about finding your way back.

Fritz the Blank
0
 
LVL 3

Expert Comment

by:tejaspurani
ID: 7154376
save this as
connectdb.html
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<script language="JavaScript">
var qStr = location.search;
alert(qStr);
function test(){
     window.location.href = "DocumentReferr.html?id=clear";
}
</script>

</HEAD>
<BODY>
<form name="frm" method=post>
     <input type=text name=txt1><br>
     <input type=button name=conect value=conect onclick="test()">
</form>
<P>&nbsp;</P>
<script language="JavaScript">
if (qStr != ""){
     rSet();
}
function rSet(){
 if(qStr.indexOf("clear") > 1 ){
          document.frm.reset();
          }
}
</script>
</BODY>
</HTML>

save this as
DocumentReferr.html
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<script language="JavaScript">
function test(){
     window.location.href = "ConnectDB.html?id=clear";
}
</script>

</HEAD>
<BODY>
<form name=frm method=post>
     <input type=button name=conect value=Back onclick="test()">
</form>
<P>&nbsp;</P>

</BODY>
</HTML>

T.P.
0
 
LVL 1

Author Comment

by:jonleehacker
ID: 7156309
T.P.

While your solution works on the pages you've done. I'm still unclear how in your

function test(){
    window.location.href = "ConnectDB.html?id=clear";

do I get my dynamically generated URL (ie: never the same twice) into where you have ConnectDB.html?id=clear. That is the whole problem. I need a way to parse out the referring page's URL and put it into a variable and then do the

function test(){
    window.location.href = "ReferrerURL_Variable?id=clear";


0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 3

Accepted Solution

by:
tejaspurani earned 150 total points
ID: 7158431
//Try This here I 'm using location.href property it
//will give u fully qualified URL then search for the file
//name and perform the action u don't need to check for
//querystring here
//connectdb.html
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<script language="JavaScript">
//alert(location.href);
//var qStr = location.search;
var qStr = location.href;
alert(qStr);
function test(){
    window.location.href = "DocumentReferr.html";
}
</script>

</HEAD>
<BODY>
<form name="frm" method=post>
    <input type=text name=txt1><br>
    <input type=button name=conect value=conect onclick="test()">
</form>
<P>&nbsp;</P>
<script language="JavaScript">
if (qStr != ""){
    rSet();
}
function rSet(){
if(qStr.indexOf("ConnectDB.html") > 1 ){
         document.frm.reset();
         }
}
</script>
</BODY>
</HTML>


//Documentreferrer.html
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<script language="JavaScript">
function test(){
    window.location.href = "ConnectDB.html";
}
</script>

</HEAD>
<BODY>
<form name=frm method=post>
    <input type=button name=conect value=Back onclick="test()">
</form>
<P>&nbsp;</P>

</BODY>
</HTML>
0
 
LVL 3

Expert Comment

by:tejaspurani
ID: 7163010
please comment.
T.P.
0
 
LVL 1

Author Comment

by:jonleehacker
ID: 7163459
Thanks, I got it to work!!!
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
A while back, I ran into a situation where I was trying to use the calculated columns feature in SharePoint 2013 to do some simple math using values in two lists. Between certain data types not being accessible, and also with trying to make a one to…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

606 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question