Forum Moderators: mack

Message Too Old, No Replies

Problems with Radio Buttons

Doesn't select just one.

         

galileo5

2:48 am on Jul 25, 2006 (gmt 0)

10+ Year Member



I'm trying to implement radio buttons on a forms page. The problem I'm having is that one button won't deselect as I'm selecting the other. I want three buttons altogether, and it allows for me to select all three at once. Of course, I can hit the reset button, but I shouldn't have to do that. Here is the code I have thus far:

<form action="insert_db.php" method="post">

Title <br />
<input size="50" type="text" name="title" /> <br /><br />

Article <br />
<textarea name="article" cols="50" rows="10"></textarea><br /><br />

<p>
<input type="radio" name="twnews" value="news"> News<br>
<input type="radio" name="twvideos" value="videos"> Videos<br>
<input type="radio" name="twpics" value="photos"> Photos<br>

<p>
<input type="submit" name="submit" value="Broadcast it!" />
<input type="reset" name="reset" value="Reset" />

</form>

Thanks for any help.

coopster

2:49 am on Jul 25, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Name them all the same:
<input type="radio" name="twoption" value="news"> News<br> 
<input type="radio" name="twoption" value="videos"> Videos<br>
<input type="radio" name="twoption" value="photos"> Photos<br>