Enjoy an ad free experience by logging in. Not a member yet?
Register .
10-20-2003, 12:55 AM
PM User |
#1
New to the CF scene
Join Date: Oct 2003
Location: Huntington Beach, CA
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Process and Popup on Input Button?
I've been playing with this script for a bit now, it's for a quiz I am making, I got each code to work fine on thier own.. so it's no problems with that. I just want the results of the Quiz to pop-up in a popup window. To do this I have to have process and popup assigned to the same input button.
I got this code to make a popup window and process.. but it processes in the same window.. and it makes a blank popup appear. c_c;
Here is the code, maybe someone here can help me? ^^;
<input type="button" Value="Submit!" onclick="window.open('yoururlhere.html', 'Sample', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=y es,width=500,height=500');process();">
10-20-2003, 01:19 AM
PM User |
#2
Smokes a Lot
Join Date: Jul 2003
Location: CA, USA
Posts: 1,594
Thanks: 5
Thanked 20 Times in 20 Posts
If I understand correctly this should work. If you want the process() to happen IN the new window on the other hand. That is different.
<html>
<head>
<script language="javascript">
function newWin(url){
new_win=window.open(url,'new_win')
}
function process()
{
alert("My Process");
}
</script>
</head>
<body>
<input type="button" value="GO!" onclick="newWin('http://www.codingforums.com');process();new_win.focus();">
</body>
</html>
10-20-2003, 01:26 AM
PM User |
#3
New to the CF scene
Join Date: Oct 2003
Location: Huntington Beach, CA
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks for the help, but that isn't what I wanted. 0o; the "process();" is supposed to give the results of the quiz, and I wanted the results of the quiz to appear in a popup window like the one I had defined. ^^;
10-20-2003, 01:42 AM
PM User |
#4
Smokes a Lot
Join Date: Jul 2003
Location: CA, USA
Posts: 1,594
Thanks: 5
Thanked 20 Times in 20 Posts
Kinda hard to tell without some code but this might get you started.
<html>
<head>
<script language="javascript">
function newWin(){
var str="Test Results"
new_win=window.open("",'new_win','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollb ars=no,resizable=no,copyhistory=y
es,width=500,height=500');
new_win.document.write(str);
}
</script>
</head>
<body>
<input type="button" value="GO!" onclick="newWin();new_win.focus();">
</body>
</html>
Last edited by Basscyst; 10-20-2003 at 02:18 AM ..
10-20-2003, 02:27 AM
PM User |
#5
New to the CF scene
Join Date: Oct 2003
Location: Huntington Beach, CA
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
;__; that code doesn't even work.. geh. Okay.
http://notopinionated.theanto.org/indigalian.php
That is the page I am having the problems with. I'd like to have the quiz results open in that page ( they aren't done yet, but I'd know if it worked ). But the code I have opens a popup, but it also makes the quiz results open in the parent window. Yeah.
10-20-2003, 02:40 AM
PM User |
#6
Supreme Master coder!
Join Date: Jun 2002
Location: Los Angeles, CA Original Location: Philippines
Posts: 10,241
Thanks: 0
Thanked 112 Times in 111 Posts
function process(){
...
location.href = out + ".php";
}
Change that location.href line to:
var w = window.open(out + ".php", "result","width=500,height=500");
w.focus();
then the button:
<input type="button" Value="Submit!" onclick="process()">
10-20-2003, 02:49 AM
PM User |
#7
New to the CF scene
Join Date: Oct 2003
Location: Huntington Beach, CA
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
^__^ Thank you very much! That is exactly what I wanted! It works great now!
Jump To Top of Thread
Thread Tools
Rate This Thread
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
All times are GMT +1. The time now is 08:07 AM .
Advertisement
Log in to turn off these ads.