Clinteney Hui Clinteney Hui - 1 year ago 85
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

Answer Source

Simply give them the same name:

<input type="radio" name="radAnswer" />
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download