mirror of
https://github.com/django/django.git
synced 2025-11-07 07:15:35 +00:00
Fixed #22383 -- Added support for HTML5 required attribute on required form fields.
This commit is contained in:
@@ -85,6 +85,8 @@ class BoundField(object):
|
||||
widget.is_localized = True
|
||||
|
||||
attrs = attrs or {}
|
||||
if not widget.is_hidden and self.field.required and self.form.use_required_attribute:
|
||||
attrs['required'] = True
|
||||
if self.field.disabled:
|
||||
attrs['disabled'] = True
|
||||
auto_id = self.auto_id
|
||||
|
||||
Reference in New Issue
Block a user