Click to See Complete Forum and Search --> : form button link with target=_blank using a perl variable


CyCo
07-10-2003, 09:38 AM
I have a perl script in which I have a perl variable as part of the URL. I want to be able to open a window with a target="_blank" using a form button, but am having problems because of the " ' " ticks around the variable. I have managed to get a window to open, but not as a new blank window. Can someone point me in the right direction?

This is what I've gotten to work, but not as a target="_blank":

<head>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function goToURL() { window.location = "$base_url/$FORM{'some_variable'}/$default"; }
// End -->
</script>
</head>

<body>
<form action="/cgi-bin/some_script.pl" method="post"><input type=button value="go to link" onclick="goToURL()"></form>
</body>



I tried this, but it doesn't give a blank target:

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function goToURL() { window.location = "$base_url/$FORM{'some_variable'}/$default", "target="_blank"; }
// End -->
</script>