...

View Full Version : Window.open [object] remove this



craig
04-06-2003, 11:41 PM
I am using the following script.

It opens a second(sized) window with the corect URL. (which it is supposed to)

But it opens a second window(advances) from the main interface and places [object] in it.

If I click the "Back" browser button it returns to the original interface.

How can I get it to remain in the main(original) interface window?

<html>
<head>
<title>untitled</title>
<script type="text/javascript" language="JavaScript">

function gotoURL(form) {
var radGrp = associations.Assoc;
for (var i=0; i<radGrp.length; i++)
if (radGrp[i].checked) {
location = radGrp[i].value; return;
}
alert('Please choose one of the Associations on the list.');

}
</script>


</head>
<body>
<form method="post" name="associations">

<input name="Assoc" type="radio" value="javascript:window.open('http://www.proamrodeo.com/database/CCPRAschs.html','assocWindow','width=800,height=500,left=10,top=120,screenX=10,screenY=120')"checked>CCPRA<br>

<input name="Assoc" type="radio" value="javascript:window.open('http://www.proamrodeo.com/database/CPRAschs.html','assocWindow','width=800,height=500,left=10,top=120,screenX=10,screenY=120')">CPRA<br>

<input name="Assoc" type="radio" value="javascript:alert('URL 3')">CPRA(TX)<br>
<input name="Assoc" type="radio" value="javascript:alert('URL 4')">CRRA<br>
<input name="Assoc" type="radio" value="javascript:alert('URL 5')">GCPRA<br>
<input name="Assoc" type="radio" value="javascript:alert('URL 6')">ICA<br>
<input name="Assoc" type="radio" value="javascript:alert('URL 6')">IMPRA<br>
<input name="Assoc" type="radio" value="javascript:alert('URL 7')">IRCA<br><br>

<a href="#" onMouseover="window.status='View Association Schedules.'; return true"
onMouseout="window.status=' '; return true" onclick="gotoURL(this.form)">Schedules</a>

</form>
</body>
</html>

cheesebagpipe
04-07-2003, 12:05 AM
Weird script...

<html>
<head>
<title>untitled</title>
<script type="text/javascript" language="JavaScript">

function gotoURL(oForm) {
var radGrp = oForm.Assoc;
for (var i=0; i<radGrp.length; i++)
if (radGrp[i].checked) {
window.open(radGrp[i].value,'assocWindow','width=800,height=500,left=10,top=120');
return false;
}
alert('Please choose one of the Associations on the list.');
return false;
}

</script>
</head>
<body>
<form method="post" name="associations">
<input name="Assoc" type="radio"
value="http://www.proamrodeo.com/database/CCPRAschs.html">CPRA(TX)<br>
<input name="Assoc" type="radio"
value="http://www.proamrodeo.com/database/CPRAschs.html">CRRA<br>
<input name="Assoc" type="radio"
value="javascript&#58;'URL 3'">CPRA(TX)<br>
<input name="Assoc" type="radio"
value="javascript&#58;'URL 4'">CRRA<br>
<input name="Assoc" type="radio"
value="javascript&#58;'URL 5'">GCPRA<br>
<input name="Assoc" type="radio"
value="javascript&#58;'URL 6'">ICA<br>
<input name="Assoc" type="radio"
value="javascript&#58;'URL 6'">IMPRA<br>
<input name="Assoc" type="radio"
value="javascript&#58;'URL 7'">IRCA<br><br>
<a href="#"
onMouseover="window.status='View Association Schedules.'; return true"
onMouseout="window.status=''; return true"
onclick="return gotoURL(document.associations)">Schedules</a>
</form>
</body>
</html>

Put this all on one line:
window.open(radGrp[i].value,'assocWindow','width=800,height=500,left=10,top=120');

craig
04-07-2003, 12:26 AM
Thank you it seems to be wroking fine now with your help.

This will eventually end up at this URL:

ProAm Rodeo.com/schedules.htm (http://www.proamrodeo.com/schedules.htm)

Why the "o" in oForm?

cheesebagpipe
04-07-2003, 12:36 AM
oForm
[object]

sVal
[string]

iLoop
[integer]

bWhich
[Boolean (T/F)]

fAmt
[floating-point number]

Helps you keep track of what's what...:cool:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum