Hiding Drop Down Boxes if Radio Button other than default is Clicked

asdek

New Member
I swear I'm going to learn more JavaScript... I have this page (which really an include file in another ASP page, but I copied the correct HTML and made it so it'd load by itself for my testing purposes):FO SamplesThis is how it should show when they first load it. If they choose one of the other radio buttons, it should HIDE the 2 dropdown boxes. Using this code (something I found from someone else's question on here), its working. \[code\]<script type="text/javascript"> function ChangeDropdowns(value) { if (value =http://stackoverflow.com/questions/14409597/="0") { document.getElementById('SAMPLEDROPDOWN').style.display = 'block'; } else { document.getElementById('SAMPLEDROPDOWN').style.display = 'none'; } }</script>\[/code\]But I can't figure out how to make it show them again if they go back to the "I wanna pick my own!" radio. The value of SAMPGROUP is the ID from the database of that sample category group. So it won't necessarily be in numerical order, it might skip #'s (if we delete a category or something). Basically, it should show the dropdowns if SAMPGROUP = 0 and not if its anything else!I tried changing my code to this (95 being the value of SAMPGROUP for the "Autumm" option), but it doesn't seem to have made a difference.\[code\]<script type="text/javascript"> function ChangeDropdowns(value) { if (value =http://stackoverflow.com/questions/14409597/="0") { document.getElementById('SAMPLEDROPDOWN').style.display = 'block'; } else if (value =http://stackoverflow.com/questions/14409597/="95") { document.getElementById('SAMPLEDROPDOWN').style.display = 'none'; } else { document.getElementById('SAMPLEDROPDOWN').style.display = 'none'; } }</script>\[/code\]Any help would be greatly appreciated!!Mahalo!
 
Back
Top