homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

dropdown menu and iframes
how to display in another iframe onChange

Msg#: 4391747 posted 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?



Msg#: 4391747 posted 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')">

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved