37 users online (2 members and 35 guests)  


  Results 1 to 12 of 12

Related

  1. Form does multiple calulations    Forum: HTML Forum
    Replies: 3
  2. Multiple drop down form woes    Forum: Javascript Forum
    Replies: 1
  3. Multiple drop down form woes    Forum: HTML Forum
    Replies: 0
  4. multiple submit buttons in single form    Forum: HTML Forum
    Replies: 7
  5. Multiple Form Inputs    Forum: HTML Forum
    Replies: 3
  1. #1
    Bluefish's Avatar
    New User

    Status
    Offline
    Join Date
    May 2003
    Posts
    5

    Multiple Menus on the Same Form?

    Heres my question...

    I'm trying to use multiple drop down menus on the same form to point to one specific web page. I have searched the web for menus and I don't see what I am trying to do. I am novice at best with HTML but I don't even know where to start understanding this. Here is an example of the form I am trying to create.

    http://www.geocities.com/yaphankwiffleball/index1.htm

    I am not aware if this can even be done. Any replies would be greatly appriciated

    Patrick

  2. #2
    QuietDean's Avatar
    Administrator

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

    Each menu (or drop-down, or select box, as they are sometimes called) usually has a different name. This is how a processor that the form submits to tells them apart.

    However, it really depends on what you are trying to do. On your example, they look like they are actually elements for sending the user to another page via javascript. Explain exactly what you wish it to do and we will see if its possible.
    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?

  3. #3
    Bluefish's Avatar
    New User

    Status
    Offline
    Join Date
    May 2003
    Posts
    5
    The pages or files I'm looking to link to are formatted text. The file names would be something like 1b22. Value 1(player) + value b(batting/pitching) + value 2(year) + value 2(opponent)

    http://www.geocities.com/yaphankwiffleball/1b22.htm

    I would like to put the drop downs in a small frame above and have have the user select attributes that would display the appropriate statistics below.

    Thanks, Patrick

  4. #4
    Bluefish's Avatar
    New User

    Status
    Offline
    Join Date
    May 2003
    Posts
    5

    Question

    Not possible to do with html??

  5. #5
    Doorknob's Avatar
    Super Newbie

    Status
    Offline
    Join Date
    Jun 2002
    Location
    Malaysia
    Posts
    316
    so you're trying to use the drop down values to go to a specific web page?

    if the value was 1b22. [Value 1(player) + value b(batting/pitching) + value 2(year) + value 2(opponent) ] then u jump to a page called 1b22.html?

    i'm not sure what you're trying to do. what do u using to process the form? ASP? PHP?

  6. #6
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    You can do this with JavaScript easily.

    I have done this myself using code amended from the Drop-Down menu maker in the Webmaster Tools section. Unfortunately, the code was used in work and I am on Holiday at the moment, no access to my own computer. However, its pretty straight-forward. Give me a little while and I will see if I can post some that does this.
    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?

  7. #7
    Bluefish's Avatar
    New User

    Status
    Offline
    Join Date
    May 2003
    Posts
    5
    Originally posted by QuietDean
    You can do this with JavaScript easily.
    Thank you for your reply. I've been looking at Javascript menu scripts and tweaking them but no luck yet. I'm certainly getting closer though.

    Also, will this work in frames? The menu being in a small frame at the top and the results displayed below?

    Patrick

  8. #8
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Okay, here we go. I Took your example page from your first post and added the JavaScript to do what i think you meant it to do. If its the wrong order or something trivial, just ask.

    On a wider note, the code is a good example of concatenating variables and object access.

    Code:
    <html>
    
    <head>
    <meta http-equiv="Content-Type"
    content="text/html; charset=iso-8859-1">
    <meta name="GENERATOR" content="Microsoft FrontPage Express 2.0">
    <title>Untitled Normal Page</title>
    <script language="JavaScript">
    function makeURL(obj) {
    
    part1=obj.firstSelect.options[obj.firstSelect.selectedIndex].value; 
    part2=obj.secondSelect.options[obj.secondSelect.selectedIndex].value; 
    part3=obj.thirdSelect.options[obj.thirdSelect.selectedIndex].value; 
    part4=obj.fourthSelect.options[obj.fourthSelect.selectedIndex].value; 
    
    // Debugging - pops up concatenated string
    //alert(part1 + part2 + part3 + part4 + '.htm');
    
    goTo = part1 + part2 + part3 + part4 + '.htm';
    
    location.href=goTo;
    
    
    }
    
    </script>
    </head>
    
    <body bgcolor="#FFFFFF">
    
    <p align="center"><img src="file:///C:/My%20Documents/header.jpg"
    width="664" height="79"></p>
    
    <form onsubmit="makeURL(this.form);return false;" name="multiSelectExample">
        <p align="center"><select name="firstSelect" size="1">
            <option value>Player</option>
            <option value="1">Patrick</option>
            <option value="2">John</option>
            <option value="3">Terence</option>
            <option value="4">Brady</option>
            <option value="5">Ketchem</option>
            <option value="6">Jimmy</option>
            <option value="7">Timothy</option>
            <option value="8">Brennan</option>
        </select> <select name="secondSelect" size="1">
            <option value>Catagory</option>
            <option value="b">Batting</option>
            <option value="p">Pitching</option>
        </select> <select name="thirdSelect" size="1">
            <option value>Year</option>
            <option value="0">Career</option>
            <option value="3">2003</option>
            <option value="2">2002</option>
            <option value="1">2001</option>
        </select> <select name="fourthSelect" size="1">
            <option value>Opponent</option>
            <option value="0">vs Everyone</option>
            <option value="1">vs Patrick</option>
            <option value="2">vs John</option>
            <option value="3">vs Terence</option>
            <option value="4">vs Brady</option>
            <option value="5">vs Ketchem</option>
            <option value="6">vs Jimmy</option>
            <option value="7">vs Timothy</option>
            <option value="8">vs Brennan</option>
        </select> <input type="button" value="Go"
    		
    	onclick = "makeURL(this.form);"
    
    
         </p>
    </form>
    
    <p><img src="blank.gif" name="doll"> </p>
    </body>
    </html>
    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?

  9. #9
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    we were posting at the same time, I think

    It wqill work with frames. Just amend the last line so that its

    Code:
    parent.framename.location.href = .....
    If memory serves me, that will work as long as you change the frame name.
    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?

  10. #10
    Bluefish's Avatar
    New User

    Status
    Offline
    Join Date
    May 2003
    Posts
    5
    Thank You, I'll give it a go now.

    The code I used was originally for selecting a .gif image of dolls or wigs or something!

    Thats where the last line ..
    <p><img src="blank.gif" name="doll"> </p>
    .. came from!

    I hadn't quite finished modifieing it. I'll let you know how it turns out. Thanks again.

    Patrick

  11. #11
    Doorknob's Avatar
    Super Newbie

    Status
    Offline
    Join Date
    Jun 2002
    Location
    Malaysia
    Posts
    316
    eww i hate javascript

  12. #12
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Really? Its essential as Client-side scripting (not many other options that don't require plugins).

    I have been playing with ActiveX recently. As power goes, its incredible. As scariness goes, its terrifying what you can do with it!
    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