homepage Welcome to WebmasterWorld Guest from 54.243.23.129
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe and Support WebmasterWorld
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
numnum




msg:4391749
 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?

 

numnum




msg:4392280
 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.

OLD:

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

NEW:

<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.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved