Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

dropdown menu and iframes

how to display in another iframe onChange



7:18 pm on Nov 28, 2011 (gmt 0)

I've got two iframes on the same page:

* iframe1 contains the dropdown menu (select one only)
* iframe2 for displaying the results

I don't want to resort to using an input button. Here's the script for returning the results in iframe2 instead of iframe1:

<SELECT NAME="mainmenu" CLASS="menu" METHOD="POST" onChange="window.open(this.options[this.selectedIndex].value,'iframe2')">

With FF and Chrome, clicking on a menu item works to return the result in iframe2. But the script doesn't work at all for IE. (Nothing happens on click.) Any ideas?


12:50 am on Nov 30, 2011 (gmt 0)

Okay, I've discovered the problem. Apparently, IE doesn't like hyphenated iframe names (value in javascript). I've changed the name of my target iframe from 'iframe-2' to'iframe2', and now it works in IE.


<SELECT onChange="window.open(this.options[this.selectedIndex].value,'iframe-2')">


<SELECT onChange="window.open(this.options[this.selectedIndex].value,'iframe2')">

Featured Threads

Hot Threads This Week

Hot Threads This Month