Hi - I cobbled together this script and made it work in a test page, but now that I'm applying it on my actual page I'm having trouble. Probably some beginner mistakes in here:
Here's the HTML that I want it to monitor:Code:<script type="text/javascript"> //script to hide or show further options depending on organization var selectmenu=document.getElementById("organization") selectmenu.onchange=function(){ var chosenoption=this.options[this.selectedIndex] if (chosenoption.value=="15"){ document.getElementById('subgroups').style.display = 'inline' } else { document.getElementById('subgroups').style.display = 'none' } </script>
Code:<select id="organization" size="1"> <option value="14" >Name1</option> <option value="18" >Name2</option> <option value="15" >Boy Scouts</option> <option value="13" >Name3</option> <option value="19" >Name4</option> <option value="16" >Name5</option> <option value="12" >Name6</option> <option value="20" >Name7</option> </select>
The idea being that when you select "Boy Scouts" (value=15), the "subgroups" id changes to display:inline.
Any help will be much appreciated.
Cheers


Reply With Quote
Bookmarks