604👍
✅
Simply give them the same name:
<input type="radio" name="radAnswer" />
- [Django]-Django :How to integrate Django Rest framework in an existing application?
- [Django]-Django-celery: No result backend configured
- [Django]-Django: How to manage development and production settings?
53👍
All radio buttons have to have the same name:
<input type='radio' name='foo'>
Only 1 radio button of each group of buttons with the same name can be checked.
👤Nick
- [Django]-Django Rest Framework – Updating a foreign key
- [Django]-Why does django run everything twice?
- [Django]-Django: Use of DATE_FORMAT, DATETIME_FORMAT, TIME_FORMAT in settings.py?
25👍
Give them the same name, and it will work. By definition Radio buttons will only have one choice, while check boxes can have many.
<input type="radio" name="Radio1" />
- [Django]-Django 1.5b1: executing django-admin.py causes "No module named settings" error
- [Django]-Altering one query parameter in a url (Django)
- [Django]-Default value for user ForeignKey with Django admin
20👍
Add “name” attribute and keep the name same for all the radio buttons in a form.
i.e.,
<input type="radio" name="test" value="value1"> Value 1
<input type="radio" name="test" value="value2"> Value 2
<input type="radio" name="test" value="value3"> Value 3
Hope that would help.
👤SuKu
- [Django]-What is "load url from future" in Django
- [Django]-Django content-type : how do I get an object?
- [Django]-Django logging of custom management commands
11👍
Just give them the same name throughout the form you are using.
<form><input type="radio" name="selection">
<input type="radio" name="selection">
..
..
</form>
- [Django]-How to define two fields "unique" as couple
- [Django]-Django custom field validator vs. clean
- [Django]-Equivalent of PHP "echo something; exit();" with Python/Django?
5👍
All the radio buttons options must have the same name for you to be able to select one option at a time.
👤B.K
- [Django]-Django-celery: No result backend configured
- [Django]-Django Installed Apps Location
- [Django]-Separating form input and model validation in Django?
1👍
Only one Step you need to follow!
Make Sure you need to add the attribute name in the opening tag with the same values of that attribute name!
Example :
<input name="18+" value="yes" id="18" type="radio">Yes
<input name="18+" value="No" id="bel" type="radio">No
- [Django]-Django 1.5b1: executing django-admin.py causes "No module named settings" error
- [Django]-How to tell if a task has already been queued in django-celery?
- [Django]-Django edit user profile
Source:stackexchange.com