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>