MultiValueDictKeyError at

42 views
Skip to first unread message

luca72.b...@gmail.com

unread,
Sep 23, 2020, 11:43:36 AM9/23/20
to Django users
Hello i have this problem :
MultiValueDictKeyError at 
The view is:
matricola = request.POST['matricola']

The form is:

matricola = forms.CharField(label='Matricola',  required = False, max_length=100, widget = forms.TextInput(attrs={'readonly':'readonly'}))

the template is 

{{ form }}

Why i get this error? 

coolguy

unread,
Sep 23, 2020, 3:19:31 PM9/23/20
to Django users
please share the views.py and template i.e. xxx.html.  i'ts not possible to tell what's wrong with the provided information....

Julio Cojom

unread,
Sep 23, 2020, 10:16:35 PM9/23/20
to django...@googlegroups.com
Readonly field and disbled field never send on form post. 

You should workaround this, for example,  with a css class.

.disabledfield{
    pointer-events: none;
    opacity: 0.4;
}

or enabling with js on send click.

Regards.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/9287bb2a-84a2-42ba-87a7-40344f75ecdcn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages