SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    Web Enthusiast
    Join Date
    Jul 2000
    Location
    Western Massachusetts, USA
    Posts
    1,389
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    secondary topics on pulldown menus

    I am creating pulldown menus (sample at
    http://www.kripalushop.org/development/)
    using HTML and simple java script.

    <form method="post">

    <select name="navbox" size="1" onchange="window.open(this.options[this.selectedIndex].value,'_top')">

    <option value>Click here to move around the site</option>

    <option value="flowers.shtml">A page about flowers</option>

    <option value="muck.shtml">A page about muck</option>

    <option value="index.shtml">Home</option>

    </select>

    </form>

    I want to add a second level to the menu so that, for example, sub pages under "flowers" appear in the drop down menu when that is clicked on. Is there a way to do it in HTML and simple Java script as in the above? I don't want to get too complicated.
    Paul C.
    ClickBasics
    http://www.clickbasics.com

  2. #2
    We like music. weirdbeardmt's Avatar
    Join Date
    May 2001
    Location
    Channel Islands Girth: Footlong
    Posts
    5,882
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Definitely -- have a browse around www.javascriptsource.com or www.js-examples.com
    I swear to drunk I'm not God.
    Matt's debating is not a crime
    Hint: Don't buy a stupid dwarf Clicky

  3. #3
    We like music. weirdbeardmt's Avatar
    Join Date
    May 2001
    Location
    Channel Islands Girth: Footlong
    Posts
    5,882
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm not sure this is exactly right, but could be modified to fit:

    http://javascript.internet.com/forms...drop-down.html
    I swear to drunk I'm not God.
    Matt's debating is not a crime
    Hint: Don't buy a stupid dwarf Clicky

  4. #4
    SitePoint Guru Vincent Puglia's Avatar
    Join Date
    Feb 2000
    Location
    where the World once stood
    Posts
    700
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi paul,

    Unfortunately, what you are asking for cannot be done as you envision it because you cannot change a page's elements/appearance easily and because you cannot put a selection list within a selection list (like the windows apps "...") . However, there are two alternatives:

    1) using (relatively) simple javascript:
    You put 2 or more selection lists on your page and fill the rightmost ones based on a selection from the previous one -- see the "Cascading Selects (I & II)" scripts/tutorials at my site.

    2) using dHTML:
    you place the second selection list within a div and change its visibility based upon the first selection list -- see the "Hiding Options in a Form" script/tutorial at my site.

    Vinny
    Where the World Once Stood
    the blades of grass
    cut me still

  5. #5
    We like music. weirdbeardmt's Avatar
    Join Date
    May 2001
    Location
    Channel Islands Girth: Footlong
    Posts
    5,882
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That cascading selects 1 seems to be exactly what he was after. In fact I reckon I might use it!
    I swear to drunk I'm not God.
    Matt's debating is not a crime
    Hint: Don't buy a stupid dwarf Clicky

  6. #6
    SitePoint Guru Vincent Puglia's Avatar
    Join Date
    Feb 2000
    Location
    where the World once stood
    Posts
    700
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi weirdbeardmt,

    Enjoy

    Vinny
    Where the World Once Stood
    the blades of grass
    cut me still

  7. #7
    Web Enthusiast
    Join Date
    Jul 2000
    Location
    Western Massachusetts, USA
    Posts
    1,389
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks all. I will have fun experimenting with all you suggestions.
    Paul C.
    ClickBasics
    http://www.clickbasics.com

  8. #8
    Web Enthusiast
    Join Date
    Jul 2000
    Location
    Western Massachusetts, USA
    Posts
    1,389
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oooops! "your" suggestions.
    Paul C.
    ClickBasics
    http://www.clickbasics.com


Bookmarks

Posting Permissions

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