Remove HTML5 validation

This commit:
- uses WTForms email fields wherever we collect email addresses
- makes sure we don’t let the default HTML5 form validation get trigged
  (using `novalidate`[1])

We don’t want to use the default validation because:
- it looks out of place
- it’s not well supported by assistive technology

1. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form#attr-novalidate
This commit is contained in:
Chris Hill-Scott
2017-10-16 16:40:03 +01:00
parent 7809a70cf3
commit 7fc2a5b134
8 changed files with 8 additions and 8 deletions

View File

@@ -20,7 +20,7 @@
page to see if there are any known issues with GOV.UK Notify.
</p>
</div>
<form method="post">
<form method="post" autocomplete="off" novalidate>
{{ textbox(form.feedback, width='1-1', hint='', rows=10) }}
{% if not current_user.is_authenticated %}
{{ textbox(form.name, width='1-1') }}

View File

@@ -13,7 +13,7 @@
</h1>
<div class="grid-row">
<div class="column-two-thirds">
<form method="post">
<form method="post" autocomplete="off" novalidate>
{{ textbox(form.feedback, width='1-1', hint='', rows=10) }}
{% if not current_user.is_authenticated %}
<h3 class="heading-medium">Do you want a reply?</h3>