Forum Moderators: open
[webmasterworld.com...]
It's much "leaner and meaner" than most of what you find on the web, very solid cross-browser support and with a nice tutorial, too.
Go see the nvidia or ATI download page, it quite the same thing as you seem to want, except that it is list instead of drop box.
++
<html>
<head>
<title>New Tutorial</title>
<script language=javascript>
<!-- hide from old browsers...
var info = new Array(
"Robert Jordan*The Wheel of Time¦The Great Hunt",
"R.A. Salvatore*The Crystal Shard¦Streams of Silver¦Homeland¦Exile¦Sojourn",
"Raymond E. Feist*Magician: Apprentice¦Magician: Master¦Silverthorn¦A Darkness At Sethanon",
"David Eddings*Pawn of Prophesy¦Queen of Sorcery¦Magician's Gambit¦Castle of Wizardry¦Enchanters' End Game"
);
/************************************************** ************************************************** **/
function stringSplit ( string, delimiter ) {
if ( string == null ¦¦ string == "" ) {
return null;
} else if ( string.split!= null ) {
return string.split ( delimiter );
} else {
var ar = new Array();
var i = 0;
var start = 0;
while( start >= 0 && start < string.length ) {
var end = string.indexOf ( delimiter, start ) ;
if( end >= 0 ) {
ar[i++] = string.substring ( start, end );
start = end+1;
} else {
ar[i++] = string.substring ( start, string.length );
start = -1;
}
}
return ar;
}
}
/************************************************** ************************************************** **/
var menu1 = new Array();
var menu2 = new Array();
/************************************************** ************************************************** **/
function createMenus () {
for ( var i=0; i < info.length; i++ ) {
menu1[i] = stringSplit ( info[i], '*' );
menu2[i] = stringSplit ( menu1[i][1], '¦' );
}
var author = document.myForm.main;
var book = document.myForm.title;
author.length = menu1.length;
book.length = menu2[0].length;
for ( var i=0; i < menu1.length; i++ ) {
author.options[i].value = menu1[i][0];
author.options[i].text = menu1[i][0];
}
document.myForm.main.selected = 0;
for (var x=0; x < menu2[0].length; x++) {
book.options[x].text = menu2[0][x];
book.options[x].value = menu2[0][x];
}
document.myForm.title.selected = 0;
}
/************************************************** ************************************************** **/
function updateMenus ( what ) {
var sel = what.selectedIndex;
if ( sel >= 0 && sel < menu1.length )
var temp = menu2[sel];
else
var temp = new Array ();
what.form.title.length = temp.length;
for ( var i = 0; i < temp.length; i++ ) {
what.form.title.options[i].text = temp[i];
what.form.title.options[i].value = temp[i];
}
what.form.title.selected=0;
}
// end of hiding -->
</script>
</head>
<body background="" bgcolor="#ffffff" text="#400040" link="#ff0080" vlink="#ff8080" alink="#ff0000" onLoad="createMenus()">
<center><h1>New Select Menu Tutorial</h1></center>
<form name=myForm><p>
Author's name:  
<select name="main" size=1 onChange="updateMenus(this)">
<option>
<option>
<option>
</select>
<p>
Titles: 
<select name="title" size=1>
<option>
<option>
<option>
</select>
</form>
</body>
</html>