View Full Version : How to get form to open in new window?
x2x3x2
06-27-2001, 05:26 AM
I've downloaded the drop-down menu with description script (Drop Menu w/Descriptions). but even after i set my default target on my page to _blank. Whenever i use the form, the link will open in the same window. help mw please?
could you post the code up?
x2x3x2
06-27-2001, 10:09 AM
2 parts to this script
==========================================================
part 1 - put your messages in here, if you add more, make sure you change "new Array(6)" to match the number of entries.
========================================================================
<script LANGUAGE="JavaScript">
//by A1 JavaScripts.com http://www.a1javascripts.com, may be used freely
//providing this credit is left intact.
//not to be exhibited in any other archive without permission
<!-- Begin
var messages = new Array(6);
messages[0] = "";
messages[1] = "This site consists of a few javascripts that you can enhance your site with";
messages[2] = "The BIGGEST webmaster index on the planet";
messages[3] = "Get your free website here with a short url. httpcity/you";
messages[4] = "The best source for free files on the internet";
messages[5] = "An excellent place to find all the clipart you will ever need";
function messageReveal() {
var messageindex = document.messageForm.messagePick.selectedIndex
document.messageForm.messageField.value = messages[messageindex];
}
function go() {
document.location = document.messageForm.messagePick.options[document.messageForm.messagePick.selectedIndex].value
}
// End -->
</script>
====================================================================
part 2 - edit your entries here
====================================================================
<form name="messageForm">
<select name="messagePick" OnChange="messageReveal()">
<option value="#">--- Select ---
<option value="http://www.a1javascripts.com/">A1 JavaScripts
<option value="http://www.123webmaster.com/">123Webmaster.com
<option value="http://www.httpcity.com/">Http City
<option value="http://www.freewarefiles.com/">FreeWare Files
<option value="http://www.1-click-clipart.com/">1-Click-Clipart
<option>Get the code!
</select>
<br><p>
<textarea name="messageField" rows=6 cols=30 wrap=virtual></textarea>
</form>
Dr. Web
06-27-2001, 03:24 PM
change the following line:
document.location = document.messageForm.messagePick.options[document.messageForm.messagePick.selectedIndex].value
}
to:
loc=document.messageForm.messagePick.value
win = window.open(loc, "dep");
}
vBulletin® v3.6.7, Copyright ©2000-2010, Jelsoft Enterprises Ltd.