Skip to content

Commit c2dea28

Browse files
authored
Fix: Form notifications (#259)
Fix: Documentation form notifications Fix: Placement form notifications Fix: Notification styling within horizontal forms Fix: Notification styling within fieldsets
1 parent 0785ea7 commit c2dea28

7 files changed

Lines changed: 268 additions & 69 deletions

File tree

‎docs/documentation/components.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ <h3 id="layout-exceptions">Uitzonderingsweergaven</h3>
113113
<li><a href="./components/layout-two-thirds-one-third.html">Tweederde eenderde</a></li>
114114
<li><a href="./components/layout-fifty-fifty.html">50/50</a></li>
115115
<li><a href="./components/layout-centered.html">Gecentreerd</a></li>
116-
<li><a href="./components/layout-form.html">Formulieren</a></li>
116+
<li><a href="./components/layout-form.html">layout-form</a></li>
117117
<li><a href="./components/layout-column-2.html">Twee kolommen</a></li>
118118
<li><a href="./components/layout-column-3.html">Drie kolommen</a></li>
119119
<li><a href="./components/layout-column-4.html">Vier kolommen</a></li>

‎docs/documentation/components/form-base-test.html‎

Lines changed: 93 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -155,93 +155,144 @@ <h4>Visueel voorbeeld:</h4>
155155
</pre>
156156

157157
<h3>Notificatie op invoerveld</h3>
158-
<h4>Visueel voorbeeld:</h4>
158+
<h4>Visueel voorbeeld foutmelding:</h4>
159159
<form action="" method="post">
160160
<label for="input-error">Input</label>
161161
<div>
162+
<input id="input-error" class="error" value="Lorem ipsum" aria-describedby="input-error-message" aria-invalid="true">
162163
<p class="error" id="input-error-message">
163164
<span>Foutmelding:</span> Lorem ipsum dolor set amet
164165
</p>
165-
<input id="input-error" class="error" value="Lorem ipsum" aria-describedby="input-error-message" aria-invalid="true">
166166
</div>
167-
167+
<button type="submit">Verzend</button>
168+
</form>
169+
170+
<p>Html-voorbeeld:</p>
171+
<pre>
172+
<code>
173+
&lt;form action="" method="post">
174+
&lt;label for="input-error">Input&lt;/label>
175+
&lt;div>
176+
&lt;input id="input-error" class="error" value="Lorem ipsum" aria-describedby="input-error-message" aria-invalid="true">
177+
&lt;p class="error" id="input-error-message">
178+
&lt;span>Foutmelding:&lt;/span> Lorem ipsum dolor set amet
179+
&lt;/p>
180+
&lt;/div>
181+
&lt;button type="submit">Verzend&lt;/button>
182+
&lt;/form>
183+
</code>
184+
</pre>
185+
186+
<h4>Visueel voorbeeld toelichting:</h4>
187+
<form action="" method="post">
168188
<label for="input-explanation">Input</label>
169189
<div>
170-
<input id="input-explanation" class="explanation" value="Lorem ipsum" aria-describedby="input-explanation-message" aria-invalid="true">
171190
<p class="explanation" id="input-explanation-message">
172191
<span>Toelichting:</span> Lorem ipsum dolor set amet
173192
</p>
193+
<input id="input-explanation" class="explanation" value="Lorem ipsum" aria-describedby="input-explanation-message" aria-invalid="true">
174194
</div>
175-
195+
<button type="submit">Verzend</button>
196+
</form>
197+
198+
<p>Html-voorbeeld:</p>
199+
<pre>
200+
<code>
201+
&lt;form action="" method="post">
202+
&lt;label for="input-explanation">Input&lt;/label>
203+
&lt;div>
204+
&lt;p class="explanation" id="input-explanation-message">
205+
&lt;span>Toelichting:&lt;/span> Lorem ipsum dolor set amet
206+
&lt;/p>
207+
&lt;input id="input-explanation" class="explanation" value="Lorem ipsum" aria-describedby="input-explanation-message" aria-invalid="true">
208+
&lt;/div>
209+
&lt;button type="submit">Verzend&lt;/button>
210+
&lt;/form>
211+
</code>
212+
</pre>
213+
214+
<h4>Visueel voorbeeld waarschuwing:</h4>
215+
<form action="" method="post">
176216
<label for="input-warning">Input</label>
177217
<div>
178-
<input id="input-warning" class="warning" value="Lorem ipsum" aria-describedby="input-warning-message" aria-invalid="true">
179218
<p class="warning" id="input-warning-message">
180219
<span>Waarschuwing:</span> Lorem ipsum dolor set amet
181220
</p>
221+
<input id="input-warning" class="warning" value="Lorem ipsum" aria-describedby="input-warning-message" aria-invalid="true">
182222
</div>
183-
223+
<button type="submit">Verzend</button>
224+
</form>
225+
226+
<p>Html-voorbeeld:</p>
227+
<pre>
228+
<code>
229+
&lt;form action="" method="post">
230+
&lt;label for="input-warning">Input&lt;/label>
231+
&lt;div>
232+
&lt;p class="warning" id="input-warning-message">
233+
&lt;span>Waarschuwing:&lt;/span> Lorem ipsum dolor set amet
234+
&lt;/p>
235+
&lt;input id="input-warning" class="warning" value="Lorem ipsum" aria-describedby="input-warning-message" aria-invalid="true">
236+
&lt;/div>
237+
&lt;button type="submit">Verzend&lt;/button>
238+
&lt;/form>
239+
</code>
240+
</pre>
241+
242+
<h4>Visueel voorbeeld bevestiging:</h4>
243+
<form action="" method="post">
184244
<label for="input-confirmation">Input</label>
185245
<div>
186246
<p class="confirmation" id="input-confirmation-message">
187247
<span>Bevestiging:</span> Lorem ipsum dolor set amet
188248
</p>
189249
<input id="input-confirmation" class="confirmation" value="Lorem ipsum" aria-describedby="input-confirmation-message" aria-invalid="true">
190250
</div>
191-
192-
<label for="input-system">Input</label>
193-
<div>
194-
<p class="system" id="input-system-message">
195-
<span>Systeembericht:</span> Lorem ipsum dolor set amet
196-
</p>
197-
<input id="input-system" class="system" value="Lorem ipsum" aria-describedby="input-system-message" aria-invalid="true">
198-
</div>
199-
</form>
251+
<button type="submit">Verzend</button>
252+
</form>
200253

201254
<p>Html-voorbeeld:</p>
202255
<pre>
203256
<code>
204257
&lt;form action="" method="post">
205-
&lt;label for="input-error">Input&lt;/label>
206-
&lt;div>
207-
&lt;p class="error" id="input-error-message">
208-
&lt;span>Foutmelding:&lt;/span> Lorem ipsum dolor set amet
209-
&lt;/p>
210-
&lt;input id="input-error" class="error" value="Lorem ipsum" aria-describedby="input-error-message" aria-invalid="true">
211-
&lt;/div>
212-
213-
&lt;label for="input-explanation">Input&lt;/label>
214-
&lt;div>
215-
&lt;input id="input-explanation" class="explanation" value="Lorem ipsum" aria-describedby="input-explanation-message" aria-invalid="true">
216-
&lt;p class="explanation" id="input-explanation-message">
217-
&lt;span>Toelichting:&lt;/span> Lorem ipsum dolor set amet
218-
&lt;/p>
219-
&lt;/div>
220-
221-
&lt;label for="input-warning">Input&lt;/label>
222-
&lt;div>
223-
&lt;input id="input-warning" class="warning" value="Lorem ipsum" aria-describedby="input-warning-message" aria-invalid="true">
224-
&lt;p class="warning" id="input-warning-message">
225-
&lt;span>Waarschuwing:&lt;/span> Lorem ipsum dolor set amet
226-
&lt;/p>
227-
&lt;/div>
228-
229258
&lt;label for="input-confirmation">Input&lt;/label>
230259
&lt;div>
231260
&lt;p class="confirmation" id="input-confirmation-message">
232261
&lt;span>Bevestiging:&lt;/span> Lorem ipsum dolor set amet
233262
&lt;/p>
234263
&lt;input id="input-confirmation" class="confirmation" value="Lorem ipsum" aria-describedby="input-confirmation-message" aria-invalid="true">
235264
&lt;/div>
236-
265+
&lt;button type="submit">Verzend&lt;/button>
266+
&lt;/form>
267+
</code>
268+
</pre>
269+
270+
<h4>Visueel voorbeeld systeembericht</h4>
271+
<form action="" method="post">
272+
<label for="input-system">Input</label>
273+
<div>
274+
<p class="system" id="input-system-message">
275+
<span>Systeembericht:</span> Lorem ipsum dolor set amet
276+
</p>
277+
<input id="input-system" class="system" value="Lorem ipsum" aria-describedby="input-system-message" aria-invalid="true">
278+
</div>
279+
<button type="submit">Verzend</button>
280+
</form>
281+
282+
<p>Html-voorbeeld:</p>
283+
<pre>
284+
<code>
285+
&lt;form action="" method="post">
237286
&lt;label for="input-system">Input&lt;/label>
238287
&lt;div>
239288
&lt;p class="system" id="input-system-message">
240289
&lt;span>Systeembericht:&lt;/span> Lorem ipsum dolor set amet
241290
&lt;/p>
242-
&lt;input id="input-system" class="system" value="Lorem ipsum" aria-describedby="input-system-message" aria-invalid="true">
291+
&lt;input id="input-system" class="system" value="Lorem ipsum" aria-describedby="input-system-message" aria-invalid="true">
243292
&lt;/div>
293+
&lt;button type="submit">Verzend&lt;/button>
244294
&lt;/form>
295+
245296
</code>
246297
</pre>
247298
</section>

‎docs/documentation/components/form-notification.html‎

Lines changed: 139 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -65,38 +65,159 @@ <h2>Benodigde stappen:</h2>
6565

6666
<h2>Aandachtspunten:</h2>
6767
<ul>
68-
<li>Voor meer informatie over beschikbare notificatie-types en het gebruik zie: <a href="notifications.html">Notificaties</a>.</li>
68+
<li>Let op: visuele feedback op het invoerveld is op zichzelf onvoldoende om toegankelijkheid en een goede gebruikerservaring te waarborgen.</li>
69+
<li>Vertel de gebruiker altijd wat de vervolgstappen zijn die zij kunnen nemen om het probleem op te lossen of om zelf verder te kunnen.</li>
70+
<li>Voeg de class toe met het type melding op het invoerveld om gebruik te maken van visuele feedback direct op het invoerveld. Voorbeeld: <code>class="error"</code>.</li>
71+
<li>Voeg voor screenreader gebruikers <code>aria-invalid="true"</code> toe aan invoervelden met een error. In de HTML-voorbeelden is dit meegenomen.</li>
72+
<li>Plaats toelichting met betrekking tot het invullen van velden boven het invoerveld, zodat de gebruiker eerst de toelichtig leest en daarna het bijbehorende invoerveld tegenkomt. Hierdoor weet de gebruiker hoe het invoerveld ingevuld dient te worden voordat deze gepresenteerd wordt. Uitzondering hierop zijn toelichtingsteksten die de gerbruiker zelf activeert door middel van de hulpknop. Die teksten worden onder het gekozen invoerveld geplaatst zodat de structuur van het formulier en het element waar de gebruiker interactie mee heeft zo min mogelijk verspringt.</li>
73+
<li>Plaats foutmeldingen altijd onder het invoerveld. Dit zorgt ervoor dat de gebruiker eerst te zien krijgt wat de context van de foutmelding is wat het begrijpen van de foutmelding toegankelijker maakt.</li>
74+
<li>Voor meer informatie over beschikbare notificatie-types en het gebruik zie: <a href="notifications.html">Notificaties</a>.</li>
6975
</ul>
7076
</section>
7177

7278
<section id="examples">
7379
<h2>Voorbeelden</h2>
7480
<p>Het basisvoorbeeld met een invoerveld en een verzendknop.</p>
7581

76-
<h3>Basis</h3>
77-
<h4>Visueel voorbeeld:</h4>
82+
<h3>Notificatie op invoerveld</h3>
83+
<h4>Visueel voorbeeld foutmelding:</h4>
84+
<form action="" method="post">
85+
<label for="input-error">Input</label>
86+
<div>
87+
<input id="input-error" class="error" value="Lorem ipsum" aria-describedby="input-error-message" aria-invalid="true">
88+
<p class="error" id="input-error-message">
89+
<span>Foutmelding:</span> Lorem ipsum dolor set amet
90+
</p>
91+
</div>
92+
<button type="submit">Verzend</button>
93+
</form>
94+
95+
<p>Html-voorbeeld:</p>
96+
<pre>
97+
<code>
98+
&lt;form action="" method="post">
99+
&lt;label for="input-error">Input&lt;/label>
100+
&lt;div>
101+
&lt;input id="input-error" class="error" value="Lorem ipsum" aria-describedby="input-error-message" aria-invalid="true">
102+
&lt;p class="error" id="input-error-message">
103+
&lt;span>Foutmelding:&lt;/span> Lorem ipsum dolor set amet
104+
&lt;/p>
105+
&lt;/div>
106+
&lt;button type="submit">Verzend&lt;/button>
107+
&lt;/form>
108+
</code>
109+
</pre>
110+
111+
<h4>Visueel voorbeeld toelichting:</h4>
112+
<form action="" method="post">
113+
<label for="input-explanation">Input</label>
114+
<div>
115+
<p class="explanation" id="input-explanation-message">
116+
<span>Toelichting:</span> Lorem ipsum dolor set amet
117+
</p>
118+
<input id="input-explanation" class="explanation" value="Lorem ipsum" aria-describedby="input-explanation-message" aria-invalid="true">
119+
</div>
120+
<button type="submit">Verzend</button>
121+
</form>
122+
123+
<p>Html-voorbeeld:</p>
124+
<pre>
125+
<code>
126+
&lt;form action="" method="post">
127+
&lt;label for="input-explanation">Input&lt;/label>
128+
&lt;div>
129+
&lt;p class="explanation" id="input-explanation-message">
130+
&lt;span>Toelichting:&lt;/span> Lorem ipsum dolor set amet
131+
&lt;/p>
132+
&lt;input id="input-explanation" class="explanation" value="Lorem ipsum" aria-describedby="input-explanation-message" aria-invalid="true">
133+
&lt;/div>
134+
&lt;button type="submit">Verzend&lt;/button>
135+
&lt;/form>
136+
</code>
137+
</pre>
138+
139+
<h4>Visueel voorbeeld waarschuwing:</h4>
140+
<form action="" method="post">
141+
<label for="input-warning">Input</label>
142+
<div>
143+
<p class="warning" id="input-warning-message">
144+
<span>Waarschuwing:</span> Lorem ipsum dolor set amet
145+
</p>
146+
<input id="input-warning" class="warning" value="Lorem ipsum" aria-describedby="input-warning-message" aria-invalid="true">
147+
</div>
148+
<button type="submit">Verzend</button>
149+
</form>
150+
151+
<p>Html-voorbeeld:</p>
152+
<pre>
153+
<code>
154+
&lt;form action="" method="post">
155+
&lt;label for="input-warning">Input&lt;/label>
156+
&lt;div>
157+
&lt;p class="warning" id="input-warning-message">
158+
&lt;span>Waarschuwing:&lt;/span> Lorem ipsum dolor set amet
159+
&lt;/p>
160+
&lt;input id="input-warning" class="warning" value="Lorem ipsum" aria-describedby="input-warning-message" aria-invalid="true">
161+
&lt;/div>
162+
&lt;button type="submit">Verzend&lt;/button>
163+
&lt;/form>
164+
</code>
165+
</pre>
166+
167+
<h4>Visueel voorbeeld bevestiging:</h4>
168+
<form action="" method="post">
169+
<label for="input-confirmation">Input</label>
170+
<div>
171+
<p class="confirmation" id="input-confirmation-message">
172+
<span>Bevestiging:</span> Lorem ipsum dolor set amet
173+
</p>
174+
<input id="input-confirmation" class="confirmation" value="Lorem ipsum" aria-describedby="input-confirmation-message" aria-invalid="true">
175+
</div>
176+
<button type="submit">Verzend</button>
177+
</form>
178+
179+
<p>Html-voorbeeld:</p>
180+
<pre>
181+
<code>
182+
&lt;form action="" method="post">
183+
&lt;label for="input-confirmation">Input&lt;/label>
184+
&lt;div>
185+
&lt;p class="confirmation" id="input-confirmation-message">
186+
&lt;span>Bevestiging:&lt;/span> Lorem ipsum dolor set amet
187+
&lt;/p>
188+
&lt;input id="input-confirmation" class="confirmation" value="Lorem ipsum" aria-describedby="input-confirmation-message" aria-invalid="true">
189+
&lt;/div>
190+
&lt;button type="submit">Verzend&lt;/button>
191+
&lt;/form>
192+
</code>
193+
</pre>
194+
195+
<h4>Visueel voorbeeld systeembericht</h4>
78196
<form action="" method="post">
79-
<label for="input-error">Input</label>
80-
<div>
81-
<input id="input-error" class="error" value="Lorem ipsum" aria-describedby="input-error-message" aria-invalid="true">
82-
<p class="error" id="input-error-message">
83-
<span>foutmelding:</span> Lorem ipsum dolor set amet
84-
</p>
85-
</div>
197+
<label for="input-system">Input</label>
198+
<div>
199+
<p class="system" id="input-system-message">
200+
<span>Systeembericht:</span> Lorem ipsum dolor set amet
201+
</p>
202+
<input id="input-system" class="system" value="Lorem ipsum" aria-describedby="input-system-message" aria-invalid="true">
203+
</div>
204+
<button type="submit">Verzend</button>
86205
</form>
87206

88-
<h4>Html-voorbeeld:</h4>
207+
<p>Html-voorbeeld:</p>
89208
<pre>
90209
<code>
91210
&lt;form action="" method="post">
92-
&lt;label for="input-error">Input&lt;/label>
93-
&lt;div>
94-
&lt;input id="input-error" class="error" value="Lorem ipsum" aria-describedby="input-error-message" aria-invalid="true">
95-
&lt;p class="error" id="input-error-message">
96-
&lt;span>foutmelding:&lt;/span> Lorem ipsum dolor set amet
97-
&lt;/p>
98-
&lt;/div>
211+
&lt;label for="input-system">Input&lt;/label>
212+
&lt;div>
213+
&lt;p class="system" id="input-system-message">
214+
&lt;span>Systeembericht:&lt;/span> Lorem ipsum dolor set amet
215+
&lt;/p>
216+
&lt;input id="input-system" class="system" value="Lorem ipsum" aria-describedby="input-system-message" aria-invalid="true">
217+
&lt;/div>
218+
&lt;button type="submit">Verzend&lt;/button>
99219
&lt;/form>
220+
100221
</code>
101222
</pre>
102223
</section>

0 commit comments

Comments
 (0)