gdanelian Posted December 2, 2008 Share Posted December 2, 2008 Hello all... I have set up a quiz question:<form action="http://********/quiz2.php" method="get" class="a1"> <p align="center">WELCOME TO MY COURSEWORK QUIZ...</p> <p align="center"><strong>Question One: Which of the following was originally designed for producing dynamic web pages </strong></p> <div align="center">The Universe <input type="radio" name="ANSWER" value="The Universe" > <br> XHMTL <input type="radio" name="ANSWER" value="XHMTL" > <br> CSS <input type="radio" name="ANSWER" value="CSS" > <br> PHP <input type="radio" name="ANSWER" value="PHP" > <br> <input type="submit" value="SUBMIT YOUR ANSWER"> </div> </form> I want to include a link called "Do you need help? Click here for a 50/50" which when clicked two of the radio buttons become hidden. How do I do this? I have seen some funky things with XML/javascript but my quiz is written in xhtml format and is linked to php functions using $_GET All help welcome! Thank you Link to comment https://forums.phpfreaks.com/topic/135235-hiding-radio-buttons-by-user-request-who-want-to-be-a-millionaire-5050-option/ Share on other sites More sharing options...
shutat Posted December 3, 2008 Share Posted December 3, 2008 Don't know if it will help, but one thing you *might* try is something like below. If you need to unhide it again, place the input stuff back as innerHTML. <html> <head> <script language="javascript"> function fifty() { var docs = document.getElementById("opt1"); docs.innerHTML = " "; } </script> </head> <body> <form> <div id="opt1">XHTML <input name="answer" value="xhtml" type="radio"><br></div> <div id="opt2">CSS <input name="answer" value="css" type="radio"><br></div> <div id="opt3">PHP <input name="answer" value="php" type="radio"><br></div> <input value="50 / 50" type="button" onclick="fifty();"> <input value="submit" type="submit"> </form> </body> </html> The downside is having to rely on client support being enabled. If you want straight html, then you could pass along the request in your link and regenerate the page. HTH Link to comment https://forums.phpfreaks.com/topic/135235-hiding-radio-buttons-by-user-request-who-want-to-be-a-millionaire-5050-option/#findComment-705405 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.