45 users online (1 members and 44 guests)  


  Results 1 to 2 of 2

Related

  1. Form does multiple calulations    Forum: HTML Forum
    Replies: 3
  2. Multiple drop down form woes    Forum: HTML Forum
    Replies: 0
  3. Multiple Menus on the Same Form?    Forum: HTML Forum
    Replies: 11
  4. multiple submit buttons in single form    Forum: HTML Forum
    Replies: 7
  5. Multiple Form Inputs    Forum: HTML Forum
    Replies: 3
  1. #1
    angelsheep's Avatar
    New User

    Status
    Offline
    Join Date
    Jun 2003
    Location
    Australia
    Posts
    1

    Multiple drop down form woes

    Hello to all.
    Please tell me what I'm doing wrong here.
    I'm trying to intergrate three drop down menus that will point to different pages (all pages will appear in an iframe named "content") and I must be doing something wrong as the first menu directs properly but the other two do nothing.
    I have this in the <head> section:

    <!-- Hide from old browsers
    function surfto(form) {
    var myindex=form.menu.selectedIndex
    if (form.menu.options[myindex].value != "0") {
    window.open(form.menu.options[myindex].value,
    target="content");}
    }
    //-->

    Then this in <body>:

    <form name=form>
    <center>
    <select name=menu onChange="surfto(this.form)" style="background-color: #EAEAEA; border: 1px solid #FF66CC; font-family: Verdana; font-size: 10px; color:#FF66CC">
    <option value="0" selected style="background-color: #FFFFFF">:: Kitty ::</option>
    <option value="aboutcats.htm">About cats</option>
    <option value="gucci.htm">Gucci</option>
    <option value="dali.htm">Dali</option>
    </select>
    <select name=menu2 onChange="surfto(this.form)" style="background-color: #EAEAEA; border: 1px solid #FF66CC; font-family: Verdana; font-size: 10px; color:#FF66CC">
    <option value="0" selected style="background-color: #FFFFFF">:: Me ::</option>
    <option value="randomfacts.htm">Random facts</option>
    <option value="aboutsite.htm">About the site</option>
    </select>
    <select name=menu3 onChange="surfto(this.form)" style="background-color: #EAEAEA; border: 1px solid #FF66CC; font-family: Verdana; font-size: 10px; color:#FF66CC">
    <option value="0" selected style="background-color: #FFFFFF">:: Pixels ::</option>
    <option value="animals.htm">Animals</option>
    <option value="pets.htm">Pets</option>
    </select>
    </form>


    Obviously, I have more links but for the sake of page length I have only included a few.
    I'm almost at my wit's end with this problem, it's quite annoying.
    I appreciate any help you might be able to give me with this problem.
    Donna

  2. #2
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    hi there.

    you are using, basically, the object this.form.menu . However, all three drop downs are all in the same form, so form.menu always points to the first dropdown box (called 'menu'.)

    easiest would be to place each dropdown in a separate form, with the select always called 'menu'. It would then work as desired.
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?



Tags for this Thread