Loading django/contrib/admin/templates/admin/change_form.html +1 −1 Original line number Diff line number Diff line Loading @@ -37,7 +37,7 @@ </ul> {% endif %}{% endif %} {% endblock %} <form {% if has_file_field %}enctype="multipart/form-data" {% endif %}action="{{ form_url }}" method="post" id="{{ opts.model_name }}_form">{% csrf_token %}{% block form_top %}{% endblock %} <form {% if has_file_field %}enctype="multipart/form-data" {% endif %}action="{{ form_url }}" method="post" id="{{ opts.model_name }}_form" novalidate>{% csrf_token %}{% block form_top %}{% endblock %} <div> {% if is_popup %}<input type="hidden" name="{{ is_popup_var }}" value="1" />{% endif %} {% if to_field %}<input type="hidden" name="{{ to_field_var }}" value="{{ to_field }}" />{% endif %} Loading django/contrib/admin/templates/admin/change_list.html +1 −1 Original line number Diff line number Diff line Loading @@ -81,7 +81,7 @@ {% endif %} {% endblock %} <form id="changelist-form" action="" method="post"{% if cl.formset.is_multipart %} enctype="multipart/form-data"{% endif %}>{% csrf_token %} <form id="changelist-form" action="" method="post"{% if cl.formset.is_multipart %} enctype="multipart/form-data"{% endif %} novalidate>{% csrf_token %} {% if cl.formset %} <div>{{ cl.formset.management_form }}</div> {% endif %} Loading docs/topics/forms/index.txt +10 −0 Original line number Diff line number Diff line Loading @@ -341,6 +341,16 @@ from that ``{{ form }}`` by Django's template language. directly tied to forms in templates, this tag is omitted from the following examples in this document. .. admonition:: HTML5 input types and browser validation If your form includes a :class:`~django.forms.URLField`, an :class:`~django.forms.EmailField` or any integer field type, Django will use the ``url``, ``email`` and ``number`` HTML5 input types. By default, browsers may apply their own validation on these fields, which may be stricter than Django's validation. If you would like to disable this behavior, set the `novalidate` attribute on the ``form`` tag, or specify a different widget on the field, like :class:`TextInput`. We now have a working web form, described by a Django :class:`Form`, processed by a view, and rendered as an HTML ``<form>``. Loading Loading
django/contrib/admin/templates/admin/change_form.html +1 −1 Original line number Diff line number Diff line Loading @@ -37,7 +37,7 @@ </ul> {% endif %}{% endif %} {% endblock %} <form {% if has_file_field %}enctype="multipart/form-data" {% endif %}action="{{ form_url }}" method="post" id="{{ opts.model_name }}_form">{% csrf_token %}{% block form_top %}{% endblock %} <form {% if has_file_field %}enctype="multipart/form-data" {% endif %}action="{{ form_url }}" method="post" id="{{ opts.model_name }}_form" novalidate>{% csrf_token %}{% block form_top %}{% endblock %} <div> {% if is_popup %}<input type="hidden" name="{{ is_popup_var }}" value="1" />{% endif %} {% if to_field %}<input type="hidden" name="{{ to_field_var }}" value="{{ to_field }}" />{% endif %} Loading
django/contrib/admin/templates/admin/change_list.html +1 −1 Original line number Diff line number Diff line Loading @@ -81,7 +81,7 @@ {% endif %} {% endblock %} <form id="changelist-form" action="" method="post"{% if cl.formset.is_multipart %} enctype="multipart/form-data"{% endif %}>{% csrf_token %} <form id="changelist-form" action="" method="post"{% if cl.formset.is_multipart %} enctype="multipart/form-data"{% endif %} novalidate>{% csrf_token %} {% if cl.formset %} <div>{{ cl.formset.management_form }}</div> {% endif %} Loading
docs/topics/forms/index.txt +10 −0 Original line number Diff line number Diff line Loading @@ -341,6 +341,16 @@ from that ``{{ form }}`` by Django's template language. directly tied to forms in templates, this tag is omitted from the following examples in this document. .. admonition:: HTML5 input types and browser validation If your form includes a :class:`~django.forms.URLField`, an :class:`~django.forms.EmailField` or any integer field type, Django will use the ``url``, ``email`` and ``number`` HTML5 input types. By default, browsers may apply their own validation on these fields, which may be stricter than Django's validation. If you would like to disable this behavior, set the `novalidate` attribute on the ``form`` tag, or specify a different widget on the field, like :class:`TextInput`. We now have a working web form, described by a Django :class:`Form`, processed by a view, and rendered as an HTML ``<form>``. Loading