Here's an example to get you started:
<html> <head> <script type="text/javascript"> function setmenu2() { var menu1 = document.getElementById('menu1'); var sel = menu1.options[menu1.selectedIndex].text; var menu2 = document.getElementById('menu2'); if (sel == "Foo") { menu2.innerHTML = "<option>Foo-1</option>" +"<option>Foo-2</option>"; } else { menu2.innerHTML = "<option>Bar-1</option>" +"<option>Bar-2</option>" +"<option>Bar-3</option>"; } } </script> </head> <body> <select id="menu1" onchange="setmenu2()"> <option>please select...</option> <option>Foo</option> <option>Bar</option> </select> <select id="menu2"> <option>- ?? -</option> </select> </body> </html>
In reply to Re^3: Dynamic Drop down in CGI
by almut
in thread Dynamic Drop down in CGI
by d0353101
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |