Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

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

irt.org | Knowledge Base | JavaScript | Window | Q264 [ previous next ]

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

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?'


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.