NathanLedet Posted August 6, 2008 Share Posted August 6, 2008 I have a simple form I want users to fill out on my page. If Option A is selected, nothing happens and all is well with the value that's there. If Option B is selected, I would like for an additional drop down menu to appear below it with selectable options. How can I achieve this? Thank you for your help! Quote Link to comment Share on other sites More sharing options...
secoxxx Posted August 6, 2008 Share Posted August 6, 2008 This is more of just javascript showing and hiding elements. I used dreamweaver for this one just as a quick example, the js is a little extreme but it works. <script type="text/javascript"> <!-- function MM_showHideLayers() { //v9.0 var i,p,v,obj,args=MM_showHideLayers.arguments; for (i=0; i<(args.length-2); i+=3) with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) { v=args[i+2]; if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; } obj.visibility=v; } } //--> </script> <body onload="MM_showHideLayers('drop','','hide')"> <form action="" method="get"> <p> <label> <input type="radio" name="RadioGroup1" value="radio" id="RadioGroup1_0" /> Radio</label> <br /> <label> <input type="radio" name="RadioGroup1" value="radio" id="RadioGroup1_1" onclick="MM_showHideLayers('drop','','show')" /> Radio</label> <br /> </p> <select name="select" id="drop"> <option value="asdas">asad</option> <option value="sadasdsad">asdasd</option> </select> </form> </body> Quote Link to comment Share on other sites More sharing options...
Third_Degree Posted August 6, 2008 Share Posted August 6, 2008 Something like this: <input onclick="javascript:document.getElementById('extra').style.visibility='visible'" type="radio" /> <input type="text" id="extra" style="visibility:hidden" /> Quote Link to comment Share on other sites More sharing options...
Third_Degree Posted August 6, 2008 Share Posted August 6, 2008 sorry secoxx didn't see your post, but yeah mine's really basic, secoxx's is all out Quote Link to comment Share on other sites More sharing options...
secoxxx Posted August 6, 2008 Share Posted August 6, 2008 sorry secoxx didn't see your post, but yeah mine's really basic, secoxx's is all out yeah, thats dreamweaver for ya lol. but yes, no ajax needed here. simple js Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.