Taylor_1978
06-12-2003, 09:20 PM
Hiya!
I am trying to get my new page 'rooms/index.php' to open up in a resized browser, using a form and button as follows:
<form method=post onsubmit="NewWindow(this.href,'Test','660','480','no','center');return false" onfocus="this.blur()" OnMouseOver="window.status='<? echo $roomname ?>'; return true" onMouseout="window.status=''" action=rooms/index.php><input style=font-size:7pt style=color:green style=background:white type=submit value='Load Room'></form>
What it does do, is open a new browser, resized correctly, but it goes to mydomain.com/undefined instead of mydomain.com/rooms/index.php
If I use it with <A HREF= then it works fine... eg:
<a href=rooms/index.php onclick="NewWindow(this.href,'Test','660','480','no','center');return false" onfocus="this.blur()" OnMouseOver="window.status='<? echo $roomname ?>'; return true" onMouseout="window.status=''" action=rooms/index.php>Load Room</a>
Problem being I do not want it to be a link as such, but the button...
Just as a FYI.. this is the script I am using in my head:
<script language="javascript" type="text/javascript">
<!--
var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',l ocation=no,directories=no,status=yes,menubar=no,toolbar=no,resizable=yes';
win=window.open(mypage,myname,settings);}
// -->
</script>
Any idea's on how I can get it to work? I am sure it's rather simple, however my expertise is PHP not JavaScript, and I have searched everywhere and cannot seem to find an answer!
Thank you in advance!
I am trying to get my new page 'rooms/index.php' to open up in a resized browser, using a form and button as follows:
<form method=post onsubmit="NewWindow(this.href,'Test','660','480','no','center');return false" onfocus="this.blur()" OnMouseOver="window.status='<? echo $roomname ?>'; return true" onMouseout="window.status=''" action=rooms/index.php><input style=font-size:7pt style=color:green style=background:white type=submit value='Load Room'></form>
What it does do, is open a new browser, resized correctly, but it goes to mydomain.com/undefined instead of mydomain.com/rooms/index.php
If I use it with <A HREF= then it works fine... eg:
<a href=rooms/index.php onclick="NewWindow(this.href,'Test','660','480','no','center');return false" onfocus="this.blur()" OnMouseOver="window.status='<? echo $roomname ?>'; return true" onMouseout="window.status=''" action=rooms/index.php>Load Room</a>
Problem being I do not want it to be a link as such, but the button...
Just as a FYI.. this is the script I am using in my head:
<script language="javascript" type="text/javascript">
<!--
var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',l ocation=no,directories=no,status=yes,menubar=no,toolbar=no,resizable=yes';
win=window.open(mypage,myname,settings);}
// -->
</script>
Any idea's on how I can get it to work? I am sure it's rather simple, however my expertise is PHP not JavaScript, and I have searched everywhere and cannot seem to find an answer!
Thank you in advance!