klipstein/dojango — Issue #73: 74 - Js-required-validation not working for MultiValueField 
Author: klipstein
Created: 2011-11-06 13:32:44+00:00
State: open

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 link: http://code.google.com/p/dojango/issues/detail?id=74