﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
34400	ModelFormSet not adding 'required' to fields	DuraNathOG	nobody	"When working with ModelFormSet, the <input> tag is not getting the 'required' attribute by default.

I've fixed this in my project by adding the following to the form.


{{{
def __init__(self, *args, **kwargs):
        super(MyForm, self).__init__(*args, **kwargs)
        for key, value in self.fields.items():
            if value.required:
                self.fields[key].widget.attrs['required'] = 'required'
}}}

Without this, the form posts to the server and fails validation, when it can/should be handled client side first. The fact 'if value.required' can be tested here leads me to believe this is a bug and should be default behaviour."	Bug	closed	Forms	4.0	Normal	invalid	form modelform modelformset		Unreviewed	0	0	0	0	0	0
