[Fixed]-In django form how to add checkboxes instead of radio button?

1👍

You can use the MultipleChoiceField in Django. https://docs.djangoproject.com/en/1.10/ref/forms/fields/#multiplechoicefield

If the choices that the user can select are coming from a model then you can use the ModelMultipleChoiceField and pass a queryset for the choices. check https://docs.djangoproject.com/en/1.10/ref/forms/fields/#modelmultiplechoicefield

👤nael

0👍

Use the django widgets

CHOICES=[('Italian','Italian'),
         ('Mexican','Mexican')]

like = forms.ChoiceField(choices=CHOICES, widget=forms.Select())
👤mtt2p

Leave a comment