Solved

Pull Down Menu (Combo button) - Onclick to IFrame

Posted on 2004-04-15
3
1,065 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
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…

743 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now