in reply to Re^2: Dynamic Drop down in CGI
in thread Dynamic Drop down in CGI
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>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Dynamic Drop down in CGI
by afoken (Chancellor) on Jun 09, 2009 at 20:04 UTC | |
by almut (Canon) on Jun 09, 2009 at 22:33 UTC | |
|
Re^4: Dynamic Drop down in CGI
by d0353101 (Novice) on Jun 10, 2009 at 10:01 UTC | |
by almut (Canon) on Jun 10, 2009 at 10:55 UTC | |
by Corion (Patriarch) on Jun 10, 2009 at 10:11 UTC | |
by d0353101 (Novice) on Jun 11, 2009 at 05:27 UTC | |
by Your Mother (Archbishop) on Jun 11, 2009 at 06:18 UTC |