Solved

need to go back and reload a page with one click

Posted on 2002-07-14
6
141 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
NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

 
LVL 3

Accepted Solution

by:
tejaspurani earned 50 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

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
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-…
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…

810 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