Skip to content

Commit 740b712

Browse files
committed
Improved validation errors
RGAA 11.11
1 parent 614738d commit 740b712

2 files changed

Lines changed: 25 additions & 2 deletions

File tree

site/assets/style.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@ iframe {
3333
height: 2lh;
3434
}
3535

36+
.Form-error {
37+
display: none;
38+
}
39+
40+
label:has(.Form-error):has(+ :user-invalid) .Form-error {
41+
display: block;
42+
}
43+
3644
.MigrationForm-output {
3745
margin-top: var(--spacing-block--l);
3846
}

site/index.html

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,27 +322,42 @@ <h2 id="support">Need a hand?</h2>
322322
</div>
323323

324324
<form method="POST" name="support" data-netlify="true">
325-
<label for="SupportForm-name">Your name</label>
325+
<label for="SupportForm-name">
326+
Your name
327+
<span class="Form-error">Please fill out your name</span>
328+
</label>
329+
326330
<input
327331
id="SupportForm-name"
328332
type="text"
329333
name="name"
330334
aria-describedby="mandatory"
335+
autocomplete="name"
331336
required
332337
/>
333338

334339
<label for="SupportForm-email">
335340
Your email address (i.e. company@example.org)
341+
<span class="Form-error">
342+
Please enter a valid email address, for example
343+
muriel.tramis@email.com
344+
</span>
336345
</label>
346+
337347
<input
338348
id="SupportForm-email"
339349
type="email"
340350
name="email"
341351
aria-describedby="mandatory"
352+
autocomplete="email"
342353
required
343354
/>
344355

345-
<label for="SupportForm-message">Your message</label>
356+
<label for="SupportForm-message">
357+
Your message
358+
<span class="Form-error">Please write a message</span>
359+
</label>
360+
346361
<textarea
347362
id="SupportForm-message"
348363
name="message"

0 commit comments

Comments
 (0)