On Fri, 2009-01-09 at 20:29 -0600, Tolu wrote:
> I tried this. The checkboxes displayed but none of them were checked:
>
> LOOKING_FOR = (
> ('Friendship', 'Friendship'),
> ('Dating', 'Dating'),
> ('A Relationship', 'A Relationship'),
> ('Networking', 'Networking'),
> )
>
> class ProfileForm(forms.ModelForm):
> lookingfor = forms.MultipleChoiceField(required=False, label='Looking
> For', widget=forms.CheckboxSelectMultiple, choices=LOOKING_FOR, initial=
> {"lookingfor": [1,2,3]})
The values in your choices list don't contain 1, 2 or 3! They are
strings like 'Friendship', etc. You have to specify things that are the
first elements in those 2-tuples you specify for choices.
Malcolm
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---