SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Enthusiast CorkyMcDoogle's Avatar
    Join Date
    Aug 2006
    Location
    Chesapeake, Maryland
    Posts
    77
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    hierarchical <select> menu

    I was wondering how to generate a hierarchical <select> drop down. Similar to the "Jump to Forum" menu on these boards.

    I just need it to go two levels. I want the 1st level to go in an <optgroup>
    and the second level items to go in <option>'s.

    My category table has typeid, typename, and parent columns. The top level items have a NULL parent value and the second level items have the typeid of the parent in the 'parent' column.

    I'm looking for something like this

    Parent <optgroup>
    - Child <option>
    - Child <option>
    - Child <option>
    Parent <optgroup>
    - Child <option>
    Parent <optgroup>
    - Child <option>
    - Child <option>

    You get the idea...

    - Thanks

  2. #2
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,788
    Mentioned
    151 Post(s)
    Tagged
    3 Thread(s)
    Did your previous thread give you what you needed for Category/subcategory using the hierarchial data method?

    it is essentially the same principle, post the code you used if it did!
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....


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
  •