...

View Full Version : Needs to open in a new window



twomt
09-24-2006, 02:41 PM
Hi,

I am using onclick and need to have this opened in a new blank window.
Tried to use target="_blank" but this doesn't work.

<input type='button' value='Comms Panel' style='width:140px' onclick="window.location.href='comms.php'">

Any ideas?

twomt
09-24-2006, 03:55 PM
Found it already somewhere else using window.open('comms.php'), is there a way I can control the size of the window that opens?

KyuubiKahiera
09-25-2006, 04:20 AM
Found it already somewhere else using window.open('comms.php'), is there a way I can control the size of the window that opens?

lol this is one thing i know how to do
here's an example


<html>
<header>
<title>Page Title</title>
</header>
<body>
<left>
<h2><b>Page Header</b></h2>
<script type="text/javascript">
<!--
function popup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
href=mylink;
else
href=mylink.href;
window.open(href, windowname, 'width=1100,height=775,scrollbars=yes');
return false;
}
//-->
</script>
<a href="website url" onClick="return popup(this, 'notes')">text</a>
</left>
</body>
<html>

NOTICE: parts of it that you fill in will be underlined

KyuubiKahiera
09-25-2006, 04:27 AM
for above, if you want to make it easier, make

website url
become

comms.php

twomt
09-25-2006, 02:00 PM
for above, if you want to make it easier, make

become

lovely, thanks a lot. Worked as expected.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum