Dynadot Aftermarket: discover domain gems worth investing in. Visit our aftermarket.

Updating one menu using another?

SpaceshipSpaceship
Namecheap AuctionsNamecheap Auctions
Spacemail by SpaceshipSpacemail by Spaceship
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

Member card: see how many threads a member started
The member card now shows a Threads number, right after Posts. The member card is the box that opens when you point at a name. Profile...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back