Results 1 to 3 of 3

Thread: Javascript issue - linking drop down list box to urls

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2002
    Location
    Ohio
    Posts
    8

    Javascript issue - linking drop down list box to urls

    Here's the little problem I have facing me...

    I have a webpage that will have frames in it... There will be a top and left frame with a main area for placing html files. However the top and left frames will be static while the main area will change.

    If I place a drop down list box on the left frame and it looks something like this:

    Code:
    <form name="dropdownlist1" method="post" action="">
      <select name="select" size="1">
        <option>Select an Event</option>
        <option>100M Dash (P)</option>
        <option>100M Dash (F)</option>
        <option>200m Dash (P)</option>
      </select>
    </form>
    How do I get each event to relate to a specific html file and show that html file that has been selected by the user to show up in the main page area? I've been told I should do this using javascript however I haven't been able to find exactly what I'm looking for. I did find an example of it here but I've tried looking at the source code and I was just confused...

    Thanks for your help!

    blkshirt

  2. #2
    Fanatic Member RealisticGraphics's Avatar
    Join Date
    Jul 1999
    Location
    Arkansas
    Posts
    655
    Here is one way:

    Code:
    <form name="frmEvent">
      <select name="select" size="1" onChange="document.location = this.options[this.selectedIndex].value">
        <option>Select an Event</option>
        <option value="http://www.yahoo.com">100M Dash (P)</option>
        <option value="http://www.google.com">100M Dash (F)</option>
        <option value="http://www.realisticgraphics.com">200m Dash (P)</option>
      </select>
    </form>
    www.RealisticGraphics.net

    Running VS.Net Enterprise & VB 6

    Other Languages: JavaScript, VBScript, VBA, HTML, CSS, ASP, SQL, XML

    MSN Messenger: kmsheff

  3. #3
    Frenzied Member Acidic's Avatar
    Join Date
    Sep 2003
    Location
    UK
    Posts
    1,090
    or (only slightly shorter):
    Code:
    <form name="frmEvent">
      <select name="select" size="1" onChange="location.href = this.value">
        <option>Select an Event</option>
        <option value="http://www.yahoo.com">100M Dash (P)</option>
        <option value="http://www.google.com">100M Dash (F)</option>
        <option value="http://www.realisticgraphics.com">200m Dash (P)</option>
      </select>
    </form>
    Have I helped you? Please Rate my posts.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width