#20684: Support form element attributes with no value ------------------------------+-------------------- Reporter: sneethling@… | Owner: nobody Type: New feature | Status: new Component: Forms | Version: 1.5 Severity: Normal | Keywords: Triage Stage: Unreviewed | Has patch: 0 Easy pickings: 0 | UI/UX: 0 ------------------------------+-------------------- There are a couple of form attributes such as required that was introduced in HTML5 that should not contain a value. For exaple required="required" is valid but for example required="true" will result in failed validation with true being marked as a bad value.
The correct use would be: <input type="email" required /> Currently in forms.py attributes cannot be specified without a value which rely on the author knowing that a value of 'true' not being valid but 'required' being ok. it would be great if Django supports valueless attributes. Perhaps doing: widget=forms.TextInput( attrs={ 'required': '' })) will result in an input of: <input type="text" required /> -- Ticket URL: <https://code.djangoproject.com/ticket/20684> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/065.289ca8b17bcecc7a82deb14fc41b45b4%40djangoproject.com. For more options, visit https://groups.google.com/groups/opt_out.