Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Regular Coder
    Join Date
    Jan 2004
    Location
    San Antonio, TX
    Posts
    131
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Question how to add more menu options in dropdowns?

    I am trying to vary the use of the script found at: http://www.javascriptkit.com/script/...plecombo.shtml

    I am wanting to have 5 items in the first dropdown menu, as many as 8 items in the second dropdown menu, and up to 15 items in the third dropdown menu. Everytime I try to add the items, I get a coding error in my browsers (I.E. 6.0-sp1) lower left hand corner, and the script will not work. I am changing the numbers to allow for the next set of values, and following the sequences exactly as shown by the script, but still not able to make this work. I am also wanting to know if it is possible for me to add a Search bar which would work in conjunction with this script. An example of what I am looking for would be to have the following.

    dropdown menu (5 items)
    dropdown menu (8 items)
    dropdown menu (15 items)
    search bar (searches a specific website using dropdown menu or independantly)
    Go! button (performs requested search)

    Any assistance provided would be greatly appreciated.

    You may reply directly to my email (crazyhorse30@excite.com) if you want, or I will be checking back here every day or so to hopefully find my answer.

    Again, Thanks for any assistance.

    Imperial Spider

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,068
    Thanks
    0
    Thanked 256 Times in 252 Posts
    Double-click that exclamation icon to see the details of the error. And could you post some related codes?
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #3
    Regular Coder
    Join Date
    Jan 2004
    Location
    San Antonio, TX
    Posts
    131
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Glenn,

    Thanks for asking me those questions, Actually, I went to read the error message that came up, and found one of the major problems, so for now, at least it is working.

    I do however have one other part of my question that I would like to have answered...I currently have the code set up to automatically go to the website upon selecting the option from the 3rd dropdown. I would like to place a "Go!" button at the bottom of the third dropdown menu, and have that send the user to the site. I also would like to add a general site navigation Search bar below the 3rd dropdown, but above the Go! button, which would work in conjuction with the dropdown menus, or could act all on its on to search for key words within a website.

    My code is way to long to post on here, so here is where I have temporarily put it up on a friends server, so that anyone who can help me, can have a better understanding of what I am doing, to tell me what I still need to do.

    Again, Any assistance is Greatly Appreciated.


    The site is http://www.tweedscott.com/ImperialSpider.html


    Again, Thanks in advance,

    Imperial Spider

  • #4
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,068
    Thanks
    0
    Thanked 256 Times in 252 Posts
    Remove the onchange handler in the 3rd combo:

    <select name="stage3" size="1" onChange="redirect2(this.options.selectedIndex)">

    Then add this button:

    <input type="button" value="Go!" onclick="redirect2()">

    And change the redirect2() function to:

    function redirect2(){
    if (temp1.selectedIndex>0) window.location.href=temp1.options[temp1.selectedIndex].value;
    }
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #5
    Regular Coder
    Join Date
    Jan 2004
    Location
    San Antonio, TX
    Posts
    131
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Glenn,

    I now have a "Go!" button, Thanks!

    But for some reason the code is showing up on the webpage, and the Go! button does not work. I copied and pasted directly from your script. Got any ideas as to what I may be doing wrong? Also, would you be able to assist me with putting up a search bar between the third dropdown menu, and the "Go!" button to search an "in TRA net" website -vs- the entire "In TER net"?

    If you could help me out with this, it would mean a great deal to me.

    I left the change on the site... the Website once again is...

    http://www.tweedscott.com/ImperialSpider.html

    Thanks again for all of your help,


    Imperial Spider

  • #6
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,068
    Thanks
    0
    Thanked 256 Times in 252 Posts
    What you did was:

    <select name="stage3" size="1"><input type="button" value="Go!" function redirect2(){
    if (temp1.selectedIndex>0) window.location.href=temp1.options[temp1.selectedIndex].value;
    }

    Do you know html and javascript?

    I said that the button should be:

    <input type="button" value="Go!" onclick="redirect2()">

    And then change the existing redirect2() function from:

    function redirect2(z){
    window.location=temp1[z].value
    }

    to:

    function redirect2(){
    if (temp1.selectedIndex>0) window.location.href=temp1.options[temp1.selectedIndex].value;
    }
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #7
    Regular Coder
    Join Date
    Jan 2004
    Location
    San Antonio, TX
    Posts
    131
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Glenn,

    Many Many Thanks!!!

    Your scripting knowledge did fix my errors. I sincerely thank you.

    I am actually pretty good with basic HTML, but I just started learning Javascript about 3 1/2 weeks ago. I am starting to get the hang of the very BASICS of it, but I do realize that I still have very very much to learn. However, I am getting there - slowly but surely thanks to great people like you.

    Again, I thank you for your assistance.


    Any Ideas about the search bar??


    Imperial Spider


  •  

    Posting Permissions

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