# Setting selected items in a forms.ModelMultipleChoiceField

**URL:** <https://forum.djangoproject.com/t/setting-selected-items-in-a-forms-modelmultiplechoicefield/10169>\
**Category:** Using Django\
**Created:** [October 19, 2021, 3:24pm UTC](https://forum.djangoproject.com/t/setting-selected-items-in-a-forms-modelmultiplechoicefield/10169 "2021-10-19T15:24:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![basictheprogram](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/basictheprogram/32/6137_2.png) [@basictheprogram](https://forum.djangoproject.com/u/basictheprogram)\
**Post date:** [October 19, 2021, 3:24pm UTC](https://forum.djangoproject.com/t/setting-selected-items-in-a-forms-modelmultiplechoicefield/10169/1 "2021-10-19T15:24:52Z")

</div>

How do I render a form with several items in the ModelMultipleChoiceField selected? So the rendered html page looks like the below:

![AAA_html](https://us1.discourse-cdn.com/flex026/uploads/djangoproject/original/2X/a/ac2f0692e9c358aa0860cdda358ba8dc86617e24.png)

```auto
    willing_to_judge = forms.ModelMultipleChoiceField(
        queryset = WillingToJudge.objects.all(),
        widget = forms.SelectMultiple,
        required = False,
        label = 'Willing to Judge:',
        help_text = 'Hold down “Control”, or “Command” on a Mac, to select more than one.',
    )

```

I tried adding `initial`

```auto
    willing_to_judge = forms.ModelMultipleChoiceField(
        queryset = WillingToJudge.objects.all(),
        widget = forms.SelectMultiple,
        initial = [WillingToJudge.MCMProblemSet.NONE],
        required = False,
        label = 'Willing to Judge:',
        help_text = 'Hold down “Control”, or “Command” on a Mac, to select more than one.',
    )

```

Changing things in ` __init__ `

```auto
self.fields['willing_to_judge'].initial = [WillingToJudge.MCMProblemSet.NONE]

```

Populating the form field is /not/ the problem. Select items in the form field is the problem. Any help would be appreciated.

Thank you.

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [October 19, 2021, 4:20pm UTC](https://forum.djangoproject.com/t/setting-selected-items-in-a-forms-modelmultiplechoicefield/10169/2 "2021-10-19T16:20:31Z")

</div>

> [@basictheprogram](#):
>
> Select items in the form field is the problem. Any help would be appreciated.

Please be more specific here. Are you saying that you cannot make any selections on the widget when its rendered on the page?  
Or are you saying that current selections in the model aren’t reflected in the widget when it’s originally rendered?  
Or are you saying that selections made on the page aren’t saved in the model?

Also, we’ll probably need to see the view in which this form is being rendered.

---

<div class="post-metadata">

**Author:** ![basictheprogram](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/basictheprogram/32/6137_2.png) [@basictheprogram](https://forum.djangoproject.com/u/basictheprogram)\
**Post date:** [October 19, 2021, 4:23pm UTC](https://forum.djangoproject.com/t/setting-selected-items-in-a-forms-modelmultiplechoicefield/10169/3 "2021-10-19T16:23:10Z")

</div>

Thanks for the quick reply @KenWhitesell but day 2 of digging and I think I was approaching the problem incorrectly and I believe I have a fix now. As you mention, the “problem” is in the view. I’ll post what works for me so if/when other come here with a similar problem my fix might help them.
