A classic example here:
http://www.webtricks.com/s
A more dynamic way here:
http://www.mattkruse.com/j
Main Topics
Browse All Topicsi want to be able to select from a drop down lets say drop down 1 this then in return picks from a listing and allows for the next drop down to be populated.
ie
first selection in drop down has
Apples
Oranges
Pears
next drop down now has if user picks Apples from first drop down
Apple 1
Apple 2
Apple 3
if a user had picked Orange then it would be
Orange 1
Orange 2
Orange 3
what im looking to do really is populate the halls of a college from a picked drop down of colleges
thank you for any help or code you may provide
im using php as well but i figured java would be better suited for this solution
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
A classic example here:
http://www.webtricks.com/s
A more dynamic way here:
http://www.mattkruse.com/j
Here's an example of how to do this using AJAX:
http://www.DecodeTheCode.c
Have any questions about it ask me... I wrote it.
this was the type of thing i was looking for
<HTML>
<HEAD>
<TITLE>Dynamic SELECTs</title>
<SCRIPT language='JavaScript'>
<!-- //
// create js arrays to hold the data for selCity
var aryCityData = new Array();
aryCityData[0] = new Array();
aryCityData[0][0] = new Option('Select a State','0');
aryCityData[1] = new Array();
aryCityData[1][0] = new Option('Los Angeles','301');
aryCityData[1][1] = new Option('Oakland','304');
aryCityData[1][2] = new Option('Rio Linde','305');
aryCityData[1][3] = new Option('San Diego','302');
aryCityData[1][4] = new Option('San Fransisco','303');
aryCityData[2] = new Array();
aryCityData[2][0] = new Option('Miami','101');
aryCityData[2][1] = new Option('Orlando','102');
aryCityData[2][2] = new Option('Tampa','103');
aryCityData[3] = new Array();
aryCityData[3][0] = new Option('Abilene','201');
aryCityData[3][1] = new Option('Austin','202');
aryCityData[3][2] = new Option('Dallas','203');
aryCityData[3][3] = new Option('Houston','204');
function reloadCities(curStateIndex
{
if ( curStateIndex < 0 ) return; // no state selected, so do nothing
var aryCityOpts = document.myform.selCity.op
aryCityOpts.length=0; // first, clear the current City options ...
// then re-load the City options with values for the current State
for ( var i=0,n=aryCityData[curState
{
//// the line below no longer works in IE5 (it works in IE4 and NS4+).
// aryCityOpts[aryCityOpts.le
//// therefore, it now takes three lines to do the same thing:
aryCityOpts.length++; // add a new Option, then put data in it (below)
aryCityOpts[aryCityOpts.le
aryCityOpts[aryCityOpts.le
}
}
// -->
</script>
</head>
<BODY onLoad='document.myform.se
<FORM name='myform' method='post' action='whatever.asp' onSubmit='return(false);'>
State:
<SELECT name='selState' size='1' onChange='reloadCities(thi
<OPTION value='0'></option>
<OPTION value='30'>California</opt
<OPTION value='10'>Florida</option
<OPTION value='20'>Texas</option>
</select><P>
City:
<SELECT name='selCity' size='1' onChange='alert(this.optio
<OPTION value=''>Select a State</option>
<OPTION></option>
<OPTION></option>
<OPTION></option>
</select><P>
</form>
</body>
</html>
the above example works for me. i only have 3 coledges and they have about 15 halls in each so it worked really well for me
thanks for all your help. alto i found the answer myself.
have you thought about what happens if the user does not have Javascript available?
just something to keep in mind. check out this solution that would work with JS off as well:
http://www.wait-till-i.com
Business Accounts
Answer for Membership
by: ZvonkoPosted on 2007-05-21 at 13:38:02ID: 19129605
JavaScript is usable for that purpose as long as the Complette list of all Colleges combinations and therir option does not go above lets say hundred options.
When you have twenty colleges and every colleg does ahve twenty options, then you have a grand total of four handred options to load with EVERY page. That is vaste of bandwidth.
Better do it then on PHP side by posting the form on select change.