Updating one menu using another?

SpaceshipSpaceship
SpaceshipSpaceship
Namecheap AuctionsNamecheap Auctions
Watch

Shorty

Established Member
Impact
28
Hey. I'm working on a project in which I need one drop down menu to change according to a selection made in another. The problem is, I don't have a damn clue how. Let's for example say I have this simple code:

HTML:
<select name="category">
<option>1</option>
<option>2</option>
<option>3</option>
</select>

<select name="subcategory">
<option>1a</option>
<option>1b</option>
<option>1c</option>
</select>
Ok, so no matter what they select in the category menu, 1a, 1b and 1c will be showed in the subcategory menu. My question is, if I have 2 other sets of menu options that correspond to the other 2 category options, how do I update the second menu to display them?

Thank you in advance for your help.
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
i'm not understanding correctly.
let me see if i can see what you want.
you want a dropmenu with several options right?
and each option to have it's "submenu" right?
if so it's easy, if not please explain more.
if it is the one i think i will post the code here after you say yes or no.
 
0
Close
Shorty said:
Hey. I'm working on a project in which I need one drop down menu to change according to a selection made in another. The problem is, I don't have a damn clue how. Let's for example say I have this simple code:

HTML:
<select name="category">
<option>1</option>
<option>2</option>
<option>3</option>
</select>

<select name="subcategory">
<option>1a</option>
<option>1b</option>
<option>1c</option>
</select>
Ok, so no matter what they select in the category menu, 1a, 1b and 1c will be showed in the subcategory menu. My question is, if I have 2 other sets of menu options that correspond to the other 2 category options, how do I update the second menu to display them?

Thank you in advance for your help.
Sounds like you're looking for something like this:
http://www.dynamicdrive.com/dynamicindex16/chainedselects/

There is also an AJAX (Asynchronous JavaScript and XML - if you're not familiar with AJAX, I would recommend reading up on it over at Wikipedia) version that as you might have guessed, reads XML to store and control the selects, which might be an option for you.

-Steve
 
1
Close
stscac that is exactly what I needed, thank you very very much! I'll update your reputation accordingly. :)
 
0
Close
CatchedCatched

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Each character of a domain name in its own box, with how to type one of them
Bookmarks: see bookmarks without a label
You can now show only the bookmarks you have not labeled. Open the label filter in the Bookmarks tab of your account menu, or on your...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back