Top Banner
01.08.2013 Accessible Web Forms adesso Tech Talk Tom Hombergs
32

Accessible Web Forms

Jul 05, 2015

Download

Technology

Tom Hombergs
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Accessible Web Forms

01.08.2013

Accessible Web Formsadesso Tech Talk

Tom Hombergs

Page 2: Accessible Web Forms
Page 3: Accessible Web Forms

Web Form

Page 4: Accessible Web Forms

Web Form

Page 5: Accessible Web Forms
Page 6: Accessible Web Forms

YourWeb Application

Web Form

Page 7: Accessible Web Forms

Without Forms

With Forms

Number of Web Applications

Page 8: Accessible Web Forms

Why Accessible?

Page 9: Accessible Web Forms

http://badforms.com/labels-inside-fields/

Page 10: Accessible Web Forms

http://badforms.com/this-field-is-really-really-required/

Page 11: Accessible Web Forms

http://badforms.com/out-of-order-pay-attention-to-the-tab-order/

Page 12: Accessible Web Forms

Can a developer workwith a badly designed form?

Reluctantly!

Page 13: Accessible Web Forms

Can John and Jane Doe workwith a badly designed form?

With luck!

Page 14: Accessible Web Forms

Can a blind user workwith a badly designed form?

With effort!

Page 15: Accessible Web Forms

With badlydesigned Forms

With accessibleForms

Contentment of Users

Page 16: Accessible Web Forms

Accessibility is to thebenefit of every user!

Page 17: Accessible Web Forms

5 Steps to an Accessible Web Form

Page 19: Accessible Web Forms

Online Bankingwith your eyes

Online Bankingwith your ears

(install a screen reader and open the file0-initial-form.html in a browser)

Page 20: Accessible Web Forms

Step 1: use fieldsets

<fieldset><legend>Field Group Title</legend>…

</fieldset>

See the file 1-fieldsets.html

Page 21: Accessible Web Forms

Step 2: use labels

<label for="name">Your name

</label><input id="name" type="text"/>

<input id="name" type="text" aria-label="Your name"/>

See the file 2-labels.html

Page 22: Accessible Web Forms

Step 3: add field hints

<input id="name" type="text"aria-describedby="nameHint"/>

<span id="nameHint">Please enter your first and last name.

</span>

See the file 3-hints.html

Page 23: Accessible Web Forms

Step 4: addrequired semantics

<input id="name" type="text"required="true"aria-required="true"/>

See the file 4-required-semantics.html

Page 24: Accessible Web Forms

Step 5: addfield semantics

<input id="mail" type="email"/><input id="phone" type="text" pattern="[0-9]+"/>

<input id="birthdate" type="date"/>…

See the file 5-field-semantics.html

Page 25: Accessible Web Forms

And what aboutWeb Frameworks?

Page 26: Accessible Web Forms

And what about Java?Controlling the Tags means

Controlling Accessibility

Page 27: Accessible Web Forms

JSF (XHTML Tag-Library)

<h:inputText><f:attribute name="required" value="true"/>

<f:attribute name="aria-required" value="true"/>

</h:inputText>

Page 28: Accessible Web Forms

Wicket (HTML)

<input wicket:id="amount"type="number"required="true"aria-required="true"aria-describedby="amountHint"

/>

Page 29: Accessible Web Forms

Wicket (Java)

amountField.add(new AttributeAppender("aria-required", "true"));

amountField.add(new AttributeAppender("aria-describedby", "amountHint"));

Page 30: Accessible Web Forms

If your server-side frameworkcan‘t control the Tags…

Page 31: Accessible Web Forms

…take controlwith JavaScript!

$(document).ready(function() {$("#amount").attr("required", "true");$("#amount").attr("aria-required", "true");$("#amount").attr("aria-describedby", "amountHint");$("#amount").attr("type", "number");…

});

See the file 6-accessified-with-jquery.html

Page 32: Accessible Web Forms

Blog: thombergs.wordpress.com

E-Mail: [email protected]

Thank you for your time.

Twitter: @TomHombergs