On Mon, Nov 17, 2008 at 11:37 AM, Bobby Roberts <[EMAIL PROTECTED]> wrote:

>
> I have a problem with one of my forms in regard to a series of
> checkboxes.  They are displaying properly on the page with the right
> values in the checkboxes.  I have this set to REQUIRED in my form.
> However, whether I check one box, or check them all, I still get this
> message:
>
>
> "Select a valid choice. That choice is not one of the available
> choices."
>
>
> My forms.py code for this form field is as follows:
>
> Designations_Choices = (
>    ('1','1'),
>    ('2','2'),
>    ('3','3'),
>    ('4','4'),
> )
>
>    Designations = forms.ChoiceField
> (choices=Designations_Choices,required=True, label = "Gift
> Designations", widget=forms.CheckboxSelectMultiple(attrs=
> {'class':'designations'}))
>
>
> Any ideas why this won't validate correctly even when 1/4 or 4/4 boxes
> are selected?
>
>
Without looking at any docs or code, it seems you have a mismatch in the
number of values expected by the form (one) and what will be returned by the
widget (multiple).  Are you sure you don't really want to be using a
MultipleChoiceField?

Karen

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to