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

Q523 How can different selections in an options field open in different frames and windows?

irt.org | Knowledge Base | JavaScript | Form 10.3 | Q523 [ previous next ]

Q523 How can different selections in an options field open in different frames and windows?

Because there are only two variable in a drop down list, the text description, and the url value, dictating which window or frame to be targeted has to be done outside of the drop down menu and in the function:

<script language="JavaScript"><!--
function go(what) {
    var whereto = what.options[what.selectedIndex].value;
    if (whereto == "http://www.irt.org/")
        top.location.href = whereto;
    else if (whereto == "http://www.ibm.com")
        parent.otherframename.location.href = whereto;
}
//--></script>

<form>
<select onChange="go(this)">
<option value="http://www.irt.org/">Internet Related Technologies
<option value="http://www.ibm.com">IBM
</select>
</form>

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.