[Fixed]-Django: Form method is_valid() always return FALSE

1👍

You can see why it’s not valid by print errors:

def createTables(request):
 if request.method == 'POST':
    form = tipoAtribute(request.POST) # No need for "or None"
    if form.is_valid():
        ....
    else:
        print form.errors
👤ahmed

0👍

It doesn’t make sense to use the Select widget with a MultipleChoiceField. Use SelectMultiple instead.

tipoAtributo = forms.MultipleChoiceField(choices=CHOICES, required=True, widget=forms.SelectMultiple())

Leave a comment