Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-20-2003, 12:55 AM   PM User | #1
Anto_J_Lareneg
New to the CF scene

 
Join Date: Oct 2003
Location: Huntington Beach, CA
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Anto_J_Lareneg is an unknown quantity at this point
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();">
Anto_J_Lareneg is offline   Reply With Quote
Old 10-20-2003, 01:19 AM   PM User | #2
Basscyst
Smokes a Lot


 
Join Date: Jul 2003
Location: CA, USA
Posts: 1,594
Thanks: 5
Thanked 20 Times in 20 Posts
Basscyst is on a distinguished road
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>
Basscyst is offline   Reply With Quote
Old 10-20-2003, 01:26 AM   PM User | #3
Anto_J_Lareneg
New to the CF scene

 
Join Date: Oct 2003
Location: Huntington Beach, CA
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Anto_J_Lareneg is an unknown quantity at this point
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. ^^;
Anto_J_Lareneg is offline   Reply With Quote
Old 10-20-2003, 01:42 AM   PM User | #4
Basscyst
Smokes a Lot


 
Join Date: Jul 2003
Location: CA, USA
Posts: 1,594
Thanks: 5
Thanked 20 Times in 20 Posts
Basscyst is on a distinguished road
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..
Basscyst is offline   Reply With Quote
Old 10-20-2003, 02:27 AM   PM User | #5
Anto_J_Lareneg
New to the CF scene

 
Join Date: Oct 2003
Location: Huntington Beach, CA
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Anto_J_Lareneg is an unknown quantity at this point
;__; 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.
Anto_J_Lareneg is offline   Reply With Quote
Old 10-20-2003, 02:40 AM   PM User | #6
glenngv
Supreme Master coder!


 
glenngv's Avatar
 
Join Date: Jun 2002
Location: Los Angeles, CA Original Location: Philippines
Posts: 10,241
Thanks: 0
Thanked 112 Times in 111 Posts
glenngv will become famous soon enough
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()">
__________________
Glenn
_____________________________________________
Play Tower of Hanoi Android app (Ad-FREE!)
Play Tower of Hanoi Android app (FREE!)
Go to Tower of Hanoi Leaderboard
Play Tower of Hanoi Facebook app
glenngv is offline   Reply With Quote
Old 10-20-2003, 02:49 AM   PM User | #7
Anto_J_Lareneg
New to the CF scene

 
Join Date: Oct 2003
Location: Huntington Beach, CA
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Anto_J_Lareneg is an unknown quantity at this point
^__^ Thank you very much! That is exactly what I wanted! It works great now!
Anto_J_Lareneg is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:07 AM.


Advertisement
Log in to turn off these ads.