google-code-export / dojango

Automatically exported from code.google.com/p/dojango
Other
1 stars 0 forks source link

Js-required-validation not working for MultiValueField #74

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Problem occours when we have MultiValueField with required=True.

MultiValueField sets required=False on every field it aggregates (in 
__init__()). Then during validation, on every field it aggregates, it uses 
MultiValueField.required to check if field was required. As far as server-side 
validation is concerned everything is OK. But in case of js-required-validation 
field is treated as not required, because MultiValueField set reqired=False on 
it.

So despite I got MultiValueField.required=True, Dojango doesn't set proper 
"required" validation in javascript on all fields. In fact all fields are 
optional, and when form is sent with an empty field, you get server-side 
validation errors: "Field X required, but empty".

I use Dojango 0.5.1, Django trunk 14865 (two months old), Python 2.7.1.

Original issue reported on code.google.com by zim...@gmail.com on 4 Feb 2011 at 10:49

GoogleCodeExporter commented 9 years ago
Could you provide a test-form with such a MultValueField? This would help me to 
fix that problem faster.
Thanks, Tobias

Original comment by tobias.k...@googlemail.com on 8 Feb 2011 at 12:10