Solved

Pull Down Menu (Combo button) - Onclick to IFrame

Posted on 2004-04-15
3
1,079 Views
Last Modified: 2008-02-26
Hello, I have an inline frame (iframe) at the bottom of the page, on the top of the page i have a combo box, i want to make an onclick on one of the combo boxes that would change the destination in the iframe, if you can do this please let me know.


0
Comment
Question by:wd006451
  • 2
3 Comments
 
LVL 16

Accepted Solution

by:
jaysolomon earned 80 total points
ID: 10834966
<select onchange="window.frames['iframeName'].src = this.value;">
0
 
LVL 4

Assisted Solution

by:monolith_888
monolith_888 earned 45 total points
ID: 10835045
<script>
function changeDest()
  {
  var newDest = document.tf.cBox.options[document.tf.cBox.selectedIndex].text;
  myIFrame.location.href = "http://"+newDest+"/";
  }
</script>

<form name="tf">
<select name="cBox" onChange="changeDest()">
  <option>www.google.com</option>
  <option>www.yahoo.com</option>
  <option>www.experts-exchange.com</option>
</select>
</form>

<iframe src="about:blank" height="200" width="600" name="myIFrame"></iframe>
0
 
LVL 4

Assisted Solution

by:monolith_888
monolith_888 earned 45 total points
ID: 10835083
I like jaysolomon's way, but I changed it to:

<select onChange="window.frames['myIFrame'].location.href = this.options[selectedIndex].text;">
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question