Answer the question
In order to leave comments, you need to log in
How to set default value for MultipleChoiceField?
I have the following form in forms.py :
class TagForm(forms.Form):
tags = forms.MultipleChoiceField()
def tag_select(request):
form = TagForm(initial={'tags' : ['15', '16']})
return render(request, '.html', context={"form" : form})
{{ form.tags }}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question