[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 152
  • Last Modified:

need to go back and reload a page with one click

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
jonleehacker
Asked:
jonleehacker
  • 3
  • 2
1 Solution
 
fritz_the_blankCommented:
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
 
tejaspuraniCommented:
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
 
jonleehackerAuthor Commented:
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
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
tejaspuraniCommented:
//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
 
tejaspuraniCommented:
please comment.
T.P.
0
 
jonleehackerAuthor Commented:
Thanks, I got it to work!!!
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now