Jump to content

Radio Buttons not clearing


Eileen Chandler

Recommended Posts

I have the following code.  When executed, if you select one button then select the other button, it does not clear the first button, so both buttons are selected.  I can't see what I've done wrong.  Any help?

 

<!DOCTYPE html>
<html>
<body>

<h2>Radio Buttons</h2>

<p>The <strong>input type="radio"</strong> defines a radio button:</p>

<form action="/action_page.php">
<tr>
<td><select name="os0">
<option value="$5 donation">$5 donation $5.00 USD</option>
<option value="$10 donation">$10 donation $10.00 USD</option>
<option value="$25 donation">$25 donation $25.00 USD</option>
<option value="$50 donation">$50 donation $50.00 USD</option>
<option value="$100 donation">$100 donation $100.00 USD</option>
</select></td></tr>
<br><br>
<tr>
<td>
  <input name="on1" 
  <input type="radio" id="memory" value="In Memory of">
  <label for="memory">In Memory of: </label><br>
  <input type="radio" id="honor" name="honor" value="In Honor of">
  <label for="honor">In Honor of: </label><br><br>
</td>
</tr>
</form> 

</body>
</html>

Link to comment
Share on other sites

Provide same name to radio button group like:

<input type="radio" id="memory" name="AnyName" value="In Memory of">

<input type="radio" id="honor" name="AnyName" name="honor" value="In Honor of">

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...