473,383 Members | 1,818 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

drop down menu

I have 2 drop down boxes on my site. I want the selection of the
first one to populate the second box. Any suggestions are
appreciated.
Jul 17 '05 #1
4 2113
ca*****@hotmail.com (Chris Healy) emerged reluctantly from the
curtain and staggered drunkenly up to the mic. In a cracked and
slurred voice he muttered:
I have 2 drop down boxes on my site. I want the selection of the
first one to populate the second box. Any suggestions are
appreciated.


Use Javascript.

--
Phil Roberts | Deedle Doot Doo Dee Dee | http://www.flatnet.net/

Jul 17 '05 #2

"Chris Healy" <ca*****@hotmail.com> wrote in message
news:35**************************@posting.google.c om...
I have 2 drop down boxes on my site. I want the selection of the
first one to populate the second box. Any suggestions are
appreciated.


I don't know how au fait you are with Javascript and so on, but here's what
I've done in the past:

Option 1:
=====================
If its a small re-population, and all the possible types can be sent with
the page without affecting speed too much, you can stored a 2-dimensional
array as follows:

MenuChoices(ChosenIndexFromFirstMenu)(0 to n)

And then populate the array when the page is called. This would work such
that each first choice would have an index, and that would allow you to
select an array of options for the second menu.

Option 2
=====================
If the total number of choices is very large, I have used a hidden IFrame in
the page to request the choices for the second menu, and then load them in
when they are returned by the server. This would require a script on the
server to receive the chosen item from the first menu, and then pass back
the relevant contents for the second one.

If you want to know more about one of these option you're welcome to e-mail
me. The first option is also very common on the web, if you do a google
search.

Hope this has helped!


Jul 17 '05 #3
Chris Healy wrote:
I have 2 drop down boxes on my site. I want the selection of the
first one to populate the second box. Any suggestions are
appreciated.


If you're looking for a PHP solution, then you'll need to submit a form
and reload the page each time a change is made. It's not good for strain
the server. PHP isn't the ideal solution for this.

On the other hand, Javascript is great for it. The best solution is
using a two dimensional array.
Jul 17 '05 #4

"neur0maniak" <us****@neur0maniak.co.uk> wrote in message
news:40***********************@ptn-nntp-reader02.plus.net...
Chris Healy wrote:
I have 2 drop down boxes on my site. I want the selection of the
first one to populate the second box. Any suggestions are
appreciated.


If you're looking for a PHP solution, then you'll need to submit a form
and reload the page each time a change is made. It's not good for strain
the server. PHP isn't the ideal solution for this.

On the other hand, Javascript is great for it. The best solution is
using a two dimensional array.


You don't need to reload the page, you just need to request the new menu
items from the server, and load them in dynamically with JavaScript...
You can implement this (as we did) using an IFrame and some javascript, or,
for example an XML object in JS can also retrieve HTTP data.
Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: KK | last post by:
Drop-down menus are the hottest thing since Wonder Bread but . . . 1. Alot of people put them in the they-look-nice-but-you-cant-code-them-right-so-they-always-look-messed-up category (a la...
10
by: Haines Brown | last post by:
I've implemented the horizontal drop down menu discussed recently in this newsgroup, and it works nicely under Galeon and Mozilla, but not IE 5.0. Here are the problems: Under IE 5.0, the...
0
by: vikram.cvk | last post by:
Hello Experts, Im trying to design a CSS vertical drop down menu which should have the following functionality. Home About Us | -->Overview
2
by: hemanth.singamsetty | last post by:
Hello there, I've a drop down menu (created using CSS & Javascript -- see code below). My problem is, whenever I click a link on the menu the new page replaces the current page (and the menu...
4
by: simon.cigoj | last post by:
I have an javascript made menu and some forms with the dropdown element. When the menu opens and scrolls down the drop down is displeyed over the menu and obscures the menu choices. I have this...
1
by: phpnewb | last post by:
Hi, I know i'm doing it wrong, but I'm using a while loop right now to create several instances of a drop down menu. It gives me undesirable results. Can you tell me the right way to do it. Below are...
3
by: rsteph | last post by:
I have a javascript drop down menu that I borrowed from a website. It utilizes a little .css to help with formatting. The menu works great, and on all 3 of the browsers I'm concerned about; but I am...
4
by: TycoonUK | last post by:
Hi, As I do not have IE7 on my computer, I was wondering if there is a fault in my CSS Menu when using IE7. Please can someone look at my site - http://www.worldofmonopoly.co.uk and tell me...
1
by: Kaland | last post by:
Do the search engines follow links that are within forms (like the drop-down menu) so that those pages are indexed? Here is the code for a sample drop-down menu that I created. <form><select...
22
by: Archanak | last post by:
Hi, I am using 2-level CSS Drop Down Menu in my perl/CGI program. here is the code. #!c:/perl/bin/perl.exe use CGI qw(:standard);
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.