View Full Version : Link question
Hi,
On my site they have to read a disclaimer. They can press Agree link or disagree link.
So my question is:
How can I make a new site pop up when they click on the agree link, AND that they getting redirected to the page they request when pressing the agree link.
Hope you understand what I mean.
Please help me out!
Thanks!
coothead
11-20-2004, 01:35 PM
Hi there djts,
and a warm welcome to these forums :)
Here is an example that may suit your needs...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>yes go here - no go there</title>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
<style type="text/css">
/*<![CDATA[*/
body {
background:#eee;
}
#container {
width:340px;
padding:10px;
border:solid 1px #000;
background:#ccc;
margin:auto;
}
#container textarea {
width:320px;
height:200px;
background:#eed;
font-family:arial;
font-size:15px;
color:#666;
margin-bottom:4px;
}
/*//]]>*/
</style>
<script type="text/javascript">
//<![CDATA[
var df=document.forms;
var m;
var urls=new Array();
urls[0]="http://www.google.com";
urls[1]="http://www.w3schools.com";
function checkCheck(n) {
if(df[0][n].checked==true) {
if(n==1) {
n=2;
}
else {
if(n==2) {
n=1;
}
}
df[0][n].checked=false;
m=n-1
}
}
function goThere() {
window.location.href=urls[m];
}
//]]>
</script>
</head>
<body>
<form action="">
<div id="container">
<textarea rows=""cols="" readonly="readonly">
Lorem ipsum dolor sit amet, consectetuer
adipiscing elit. Praesent blandit venenatis
purus. Integer massa libero, vehicula id,
consequat sed, tincidunt nec, purus. Class
aptent taciti sociosqu ad litora torquent per
conubia nostra, per inceptos hymenaeos.
Suspendisse potenti. Nunc vulputate magna
non magna. Aenean lorem eros, adipiscing
quis, semper non, dictum a, nunc. Curabitur
ut sem. Pellentesque a est id neque hendrerit
ultrices. Donec vulputate tincidunt turpis.
Curabitur dignissim vestibulum nunc. Aliquam
felis lorem, ultrices sit amet, convallis a,
accumsan vel, ante. Proin aliquam turpis sed
augue. In pellentesque, magna a pulvinar
adipiscing, est orci adipiscing felis, sed laoreet
urna magna quis neque. Proin facilisis aliquet urna.
</textarea>
<label>yes : </label><input type="checkbox" onclick="checkCheck(1)"/>
<label>no : </label><input type="checkbox" onclick="checkCheck(2)"/>
<input type="button" value="next" onclick="goThere()"/>
</div>
</form>
</body>
</html>
Thanks :)
Almost there....
I want a new page pop-up when clicking the "Next" link.
Look at this site:
http://albums.ixmusic.net/
There you see a box comming up were you can press OK or Cancel.
Click on OK. Then a site pops up and the box goes away.
I want it like that.
Please help me out!
coothead
11-20-2004, 04:22 PM
Hi there djts,
what you see on that site is not a pop-up :supereek:
It is just a table with images :D
If you want a real pop-up then see this modification...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>yes go here - no go there</title>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
<style type="text/css">
/*<![CDATA[*/
body {
background:#eee;
}
#container {
width:340px;
padding:10px;
border:solid 1px #000;
background:#ccc;
margin:auto;
}
#container textarea {
width:320px;
height:200px;
background:#eed;
font-family:arial;
font-size:15px;
color:#666;
margin-bottom:4px;
}
/*//]]>*/
</style>
<script type="text/javascript">
//<![CDATA[
var df=document.forms;
var m;
var urls=new Array();
urls[0]="http://www.google.com";
urls[1]="http://www.w3schools.com";
var h=screen.height/2;
var w=screen.width/2;
var t=(screen.height-h)/2;
var l=(screen.width-w)/2;
var features="top="+t+",left="+l+",height="+h+",width="+w+",scrollbars=yes";
function checkCheck(n) {
if(df[0][n].checked==true) {
if(n==1) {
n=2;
}
else {
if(n==2) {
n=1;
}
}
df[0][n].checked=false;
m=n-1
}
}
function goThere() {
window.open(urls[m],"",features);
}
//]]>
</script>
</head>
<body>
<form action="">
<div id="container">
<textarea rows=""cols="" readonly="readonly">
Lorem ipsum dolor sit amet, consectetuer
adipiscing elit. Praesent blandit venenatis
purus. Integer massa libero, vehicula id,
consequat sed, tincidunt nec, purus. Class
aptent taciti sociosqu ad litora torquent per
conubia nostra, per inceptos hymenaeos.
Suspendisse potenti. Nunc vulputate magna
non magna. Aenean lorem eros, adipiscing
quis, semper non, dictum a, nunc. Curabitur
ut sem. Pellentesque a est id neque hendrerit
ultrices. Donec vulputate tincidunt turpis.
Curabitur dignissim vestibulum nunc. Aliquam
felis lorem, ultrices sit amet, convallis a,
accumsan vel, ante. Proin aliquam turpis sed
augue. In pellentesque, magna a pulvinar
adipiscing, est orci adipiscing felis, sed laoreet
urna magna quis neque. Proin facilisis aliquet urna.
</textarea>
<label>yes : </label><input type="checkbox" onclick="checkCheck(1)"/>
<label>no : </label><input type="checkbox" onclick="checkCheck(2)"/>
<input type="button" value="next" onclick="goThere()"/>
</div>
</form>
</body>
</html>
Almost there again :)
But when the pop up comes up I want the visitor to get redirected to another site (the page were the box is)
Two things in one click:
1. Getting redirected to another page
2. And a site pops up.
The site I wanted you to check out. There you see the box got removed when you clicked the link + a new site popped up.
It's so hard to explain when I'm from Norway :(
coothead
11-21-2004, 10:14 AM
Hi there djts,
my sister-in-law is Norwegian :)
I never understand her either :supereek:
Try this third offering then...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>yes go here - no go there</title>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
<style type="text/css">
/*<![CDATA[*/
body {
background:#eee;
}
#container {
width:340px;
padding:10px;
border:solid 1px #000;
background:#ccc;
margin:auto;
}
#container textarea {
width:320px;
height:200px;
background:#eed;
font-family:arial;
font-size:15px;
color:#666;
margin-bottom:4px;
}
/*//]]>*/
</style>
<script type="text/javascript">
//<![CDATA[
var df=document.forms;
var m;
var urls=new Array();
urls[0]="http://www.hell.com/";
urls[1]="http://www.w3schools.com";
var message=new Array();
message[0]="You have chosen the no option. The destination of this unwise choice is..."+urls[0];
message[1]="You have chosen the yes option. The destination of this sensible choice is..."+urls[1];
var h=screen.height/4;
var w=screen.width/2.5;
var t=(screen.height-h)/2;
var l=(screen.width-w)/2;
var features="top="+t+",left="+l+",height="+h+",width="+w+",scrollbars=yes";
function checkCheck(n) {
if(df[0][n].checked==true) {
if(n==1) {
n=2;
}
else {
if(n==2) {
n=1;
}
}
df[0][n].checked=false;
m=n-1
}
}
function goThere() {
if(isNaN(m)) {
return;
}
else {
var mypopup=window.open("","",features);
mypopup.document.write('<html><body style="margin:25px;background:#eed;font-size:18px;color:#666">'+message[m]+
'<p style="text-align:center"><a href='+urls[m]+
' target="_blank"onclick=setTimeout("window.close()",1)>'+
'go there</a></p></body></html>');
mypopup.document.close();
mypopup.focus();
}
}
//]]>
</script>
</head>
<body>
<form action="">
<div id="container">
<textarea rows=""cols="" readonly="readonly">
Lorem ipsum dolor sit amet, consectetuer
adipiscing elit. Praesent blandit venenatis
purus. Integer massa libero, vehicula id,
consequat sed, tincidunt nec, purus. Class
aptent taciti sociosqu ad litora torquent per
conubia nostra, per inceptos hymenaeos.
Suspendisse potenti. Nunc vulputate magna
non magna. Aenean lorem eros, adipiscing
quis, semper non, dictum a, nunc. Curabitur
ut sem. Pellentesque a est id neque hendrerit
ultrices. Donec vulputate tincidunt turpis.
Curabitur dignissim vestibulum nunc. Aliquam
felis lorem, ultrices sit amet, convallis a,
accumsan vel, ante. Proin aliquam turpis sed
augue. In pellentesque, magna a pulvinar
adipiscing, est orci adipiscing felis, sed laoreet
urna magna quis neque. Proin facilisis aliquet urna.
</textarea>
<label>yes : </label><input type="checkbox" onclick="checkCheck(1)"/>
<label>no : </label><input type="checkbox" onclick="checkCheck(2)"/>
<input type="button" value="next" onclick="goThere()"/>
</div>
</form>
</body>
</html>
hehehe....
almost again :)
No I shall try explain so you understand:
Look at this site again:
http://albums.ixmusic.net/
There you see a box were it stands some rules.... and you can press an OK button.
Try to press the OK button. Then a site pops up and the box go away.
How do I do this?
coothead
11-21-2004, 05:16 PM
Hi there djts
the box does not go away :supereek:
It is still there under the window that the OK image opened :rolleyes:
My script does close the pop-up :cool:
But if you want imitation buttons then imitation buttons you shall have ;)
I have nicked them from your favourite site :D
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>yes go here - no go there</title>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
<style type="text/css">
/*<![CDATA[*/
body {
background:#eee;
}
#container {
width:340px;
padding:10px;
border:solid 1px #000;
background:#ccc;
margin:auto;
}
#container textarea {
width:320px;
height:200px;
background:#eed;
font-family:arial;
font-size:15px;
color:#666;
margin-bottom:4px;
}
/*//]]>*/
</style>
<script type="text/javascript">
//<![CDATA[
var df=document.forms;
var m;
var urls=new Array();
urls[0]="http://www.hell.com/";
urls[1]="http://www.w3schools.com";
var message=new Array();
message[0]="You have chosen the no option. The destination of this unwise choice is..."+urls[0];
message[1]="You have chosen the yes option. The destination of this sensible choice is..."+urls[1];
var h=screen.height/4;
var w=screen.width/2.5;
var t=(screen.height-h)/2;
var l=(screen.width-w)/2;
var features="top="+t+",left="+l+",height="+h+",width="+w+",scrollbars=yes";
function checkCheck(n) {
if(df[0][n].checked==true) {
if(n==1) {
n=2;
}
else {
if(n==2) {
n=1;
}
}
df[0][n].checked=false;
m=n-1
}
}
function goThere() {
if(isNaN(m)) {
return;
}
else {
var mypopup=window.open("","",features);
mypopup.document.write('<html><body style="margin:25px;background:#eed;font-size:18px;color:#666">'+message[m]+
'<p style="text-align:center"><a href='+urls[m]+
' target="_blank"onclick=setTimeout("window.close()",1)>'+
'<img src="http://ixmusic.net/ok.gif" border="0"style="margin:10px;border:0px"></a><a href="javascript:void(window.close())" >'+
'<img src="http://ixmusic.net/cancel.gif" style="margin:10px;border:0px"></a></p></body></html>');
mypopup.document.close();
mypopup.focus();
}
}
//]]>
</script>
</head>
<body>
<form action="">
<div id="container">
<textarea rows=""cols="" readonly="readonly">
Lorem ipsum dolor sit amet, consectetuer
adipiscing elit. Praesent blandit venenatis
purus. Integer massa libero, vehicula id,
consequat sed, tincidunt nec, purus. Class
aptent taciti sociosqu ad litora torquent per
conubia nostra, per inceptos hymenaeos.
Suspendisse potenti. Nunc vulputate magna
non magna. Aenean lorem eros, adipiscing
quis, semper non, dictum a, nunc. Curabitur
ut sem. Pellentesque a est id neque hendrerit
ultrices. Donec vulputate tincidunt turpis.
Curabitur dignissim vestibulum nunc. Aliquam
felis lorem, ultrices sit amet, convallis a,
accumsan vel, ante. Proin aliquam turpis sed
augue. In pellentesque, magna a pulvinar
adipiscing, est orci adipiscing felis, sed laoreet
urna magna quis neque. Proin facilisis aliquet urna.
</textarea>
<label>yes : </label><input type="checkbox" onclick="checkCheck(1)"/>
<label>no : </label><input type="checkbox" onclick="checkCheck(2)"/>
<input type="button" value="next" onclick="goThere()"/>
</div>
</form>
</body>
</html>
Yes... like that.... but now we shall talk about the box that pops up with the OK button on.
I don't want the box to go away when I click OK. I want it to redirect to another page at the same time the page pops up.
Now I think you understand :)
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.