Clinteney Hui Clinteney Hui - 1 month ago 4x
HTML Question

how to set that only one radio button can be checked

{% for each in AnswerQuery %}
<form action={{address}}>
<span>{{each.answer}}</span><input type='radio'>
{% endfor %}

this is a part my django template, what it supposed to do is to print out several radio button corresponding to the answers assigned to the buttons. But I dont know why that I can check multiple radio buttons, which messed me up. It is supposed to only let me check on one radio button and I had that somehow but I lost it. Any help? Thank you


Simply give them the same name:

<input type="radio" name="radAnswer" />