Changing an iframe depending on value of <select>

Discussion in 'JavaScript' started by blueparukia, Sep 13, 2007.

  1. #1
    My current code:

    <select name="SelectURL" onChange="document.location.href=document.breed.SelectURL.options[document.breed.SelectURL.selectedIndex].value"
    <option value="stuff.html">Item1</option></select>
    
    Code (markup):

    Basically I also have an iframe.

    <iframe name="stuff1"></iframe>


    So I want to change that javascript, so instead of going to the url, it just changes the iframe to that url.



    Thanks,

    BP
     
    blueparukia, Sep 13, 2007 IP
  2. ezpz

    ezpz Peon

    Messages:
    25
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    frames['stuff1'].location.href =
      document.breed.SelectURL.options[document.breed.SelectURL.selectedIndex].value;
    Code (markup):
     
    ezpz, Sep 15, 2007 IP
    blueparukia likes this.
  3. blueparukia

    blueparukia Well-Known Member

    Messages:
    1,564
    Likes Received:
    71
    Best Answers:
    7
    Trophy Points:
    160
    #3
    Thank you, I was starting to think no one woulld respond to this.

    Rep given :)

    BP
     
    blueparukia, Sep 16, 2007 IP