Skip to content

Commit

Permalink
forms shouldn't use browser validation but our own error messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
goapunk authored and m4ra committed Apr 18, 2024
1 parent 5300256 commit 51fb9b9
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ <h1 class="mt-0">{{ view.title }}</h1>
<span>{{ error }}</span>
{% endfor %}

<form enctype="multipart/form-data" action="{{ request.path }}" method="post">
<form novalidate enctype="multipart/form-data" action="{{ request.path }}" method="post">
{% csrf_token %}

{% include view.form_template_name %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% load i18n %}
<form enctype="multipart/form-data" action="{{ request.path }}" method="post">
<form novalidate enctype="multipart/form-data" action="{{ request.path }}" method="post">
{% csrf_token %}
{{ form.media }}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</nav>

<h1>{% translate 'Feedback on this idea' %}</h1>
<form enctype="multipart/form-data" action="{{ request.path }}" method="post">
<form novalidate enctype="multipart/form-data" action="{{ request.path }}" method="post">
{% csrf_token %}
{% for form in forms.values %}
{{ form.media }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% load i18n %}
<form enctype="multipart/form-data" action="{{ request.path }}" method="post">
<form novalidate enctype="multipart/form-data" action="{{ request.path }}" method="post">
{% csrf_token %}
{{ form.media }}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ <h1 class="u-first-heading">{% translate 'Edit live stream' %}</h1>
{% endfor %}


<form enctype="multipart/form-data" action="{{ request.path }}" method="post">
<form novalidate enctype="multipart/form-data" action="{{ request.path }}" method="post">
{% csrf_token %}

{% include 'a4_candy_contrib/includes/form_field.html' with field=form.live_stream %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% load i18n %}
<form enctype="multipart/form-data" action="{{ request.path }}" method="post">
<form novalidate enctype="multipart/form-data" action="{{ request.path }}" method="post">
{% csrf_token %}
{{ form.media }}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</nav>

<h1>{% translate 'Moderate idea' %}</h1>
<form enctype="multipart/form-data" action="{{ request.path }}" method="post">
<form novalidate enctype="multipart/form-data" action="{{ request.path }}" method="post">
{% csrf_token %}
{% for form in forms.values %}
{{ form.media }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<div class="col-md-9">
<h1 class="u-first-heading">{% translate "Create Newsletter" %}</h1>

<form enctype="multipart/form-data" action="{{ request.path }}" method="post">
<form novalidate enctype="multipart/form-data" action="{{ request.path }}" method="post">
{% csrf_token %}
{% include 'a4_candy_contrib/includes/form_field.html' with field=form.project %}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% load i18n %}
<form enctype="multipart/form-data" action="{{ request.path }}" method="post">
<form novalidate enctype="multipart/form-data" action="{{ request.path }}" method="post">
{% csrf_token %}

{% include 'a4_candy_contrib/includes/form_field.html' with field=form.event_type %}
Expand Down
4 changes: 3 additions & 1 deletion changelog/7632.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@
- update a4 to ckeditor5-transition-a4
- add image validator which validates that all img tags have the alt attribute
set to all ckedito5 fields

- disable browser-side form checks for forms which use ckeditor by adding
`novalidate` to them This is necessary as ckeditor form fields which are
required will block form submission otherwise.

0 comments on commit 51fb9b9

Please sign in to comment.