Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1109
  • Last Modified:

Pull Down Menu (Combo button) - Onclick to IFrame

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
wd006451
Asked:
wd006451
  • 2
3 Solutions
 
jaysolomonCommented:
<select onchange="window.frames['iframeName'].src = this.value;">
0
 
monolith_888Commented:
<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
 
monolith_888Commented:
I like jaysolomon's way, but I changed it to:

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

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now