Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q264 How can I target another window when using a drop down menu?

You are here: irt.org | FAQ | JavaScript | Window | Q264 [ previous next ]

For this to work you must know the name of the window (e.g. windowName). If the winodw already exists by that name, then the page requested will be loaded into it, if not, then a new window will be opened:

<script language="JavaScript"><!--
function goto_URL(object) {
   window.open(object.options[object.selectedIndex].value,'windowName');
   return false;
}
//--></script>

<form>
<select name="selectName">
<option value="apage.html">A page
<option value="bpage.html">Another page
</select>
<input type="submit" value="Go" onClick="return goto_URL(this.form.selectName)">
</form>

Feedback on 'Q264 How can I target another window when using a drop down menu?'

©2018 Martin Webb