NameSilo

Updating one menu using another?

Spaceship 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
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
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
•••
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
•••
stscac that is exactly what I needed, thank you very very much! I'll update your reputation accordingly. :)
 
0
•••
Dynadot — .com Registration $8.99Dynadot — .com Registration $8.99
Appraise.net

We're social

Unstoppable Domains
Domain Recover
DomainEasy — Zero Commission
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back