Jump to content

Hiding Radio Buttons by User Request (Who want to be a millionaire 50/50 option)


gdanelian

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.