Click to See Complete Forum and Search --> : Html Links


pandu
06-22-2006, 06:52 AM
Hi all,

How do a add a link on dynamically generated page? so that i can go back to the original page.

thanks

sridhar_423
06-22-2006, 07:10 AM
window.opener.location.href -- url of your parent page when referred to from your newly generated page

pandu
06-22-2006, 07:24 AM
Hi,

where acxatly do a place this code?
Because I'm using a form.
In this form when a user fill it and send it and reprot will be generated.
Now I need a link in the generated page which will allow the user to go back to the original page.

thanks

sridhar_423
06-22-2006, 08:05 AM
onload=function(){
var body = document.getElementsByTagName("body")[0];
var link="<a href=\""+window.opener.location.href+"\">Go to Parent Page</a>";
body.insertAdjacentHTML("beforeEnd",link)
}

this will insert the link just at the ending of the page.
To customize the position, instead of "body" give the "ID" of some DIV/ Span or any element around which u want to insert the link.
Hope this helps..

pandu
06-22-2006, 10:25 AM
Hi,
I'm assuming that I should put this inside javascript or something, correct?
But when I did nothing happened.

pandu
06-22-2006, 11:02 AM
Sorry i forgot,
My code look like this:


<html>

<head>
<title>SQL*Plus Dynamic Report</title>
</head>

<body>
<p>
<img border="0" src="mylogo.gif" width="220" height="62"></p>
<H1><em>i</em>SQL*Plus Report</H1>
<H2>Attendance register</H2>
<FORM METHOD=get ACTION="http://work.com:7777/isqlplus">
<INPUT TYPE="hidden" NAME="script" VALUE="http://work.com:7777/reports/att_reg.sql">
Date From (Format dd-mm-yyyy i.e. 01-feb-2006): <INPUT TYPE="text" NAME="date_from" SIZE="11"><br>
Date to (Format dd-mm-yyyy i.e. 28-feb-2006): <INPUT TYPE="text" NAME="date_to" SIZE="11"><br>
Time from (hhmmss i.e. 080000): <INPUT TYPE="text" NAME="time_from" SIZE="6"><br>
Time to (hhmmss i.e 083000): <input type="text" name="time_to" SIZE="6"><br>
<INPUT TYPE="submit" VALUE="Run Report">
</FORM>

</body>
</html>