SlideShare una empresa de Scribd logo
1 de 30
Accessible Dynamic Forms
and Form Validation with
jQuery
Dylan Barrell (@dylanbarrell)
Vice President of Product Development
October, 2013
Examples and Code
• GitHub Repository with Examples
– https://github.com/dylanb/a11yvalid

• Uses a11yfy code
– https://github.com/dylanb/a11yfy
Overview
•

Commonly Violated WCAG 2.0 (A, AA) SC

•

Form Accessibility Fundamentals
–
–

Instructions

–

Layout

–

Dynamism

–
•

Labels

Controls

Validation Fundamentals
–

Fundamentals

–

Layout and navigation

–

Error messages and summaries
Common Success Criteria
Perceivable
•

All labels must be programmatically associated with the input
field [WCAG 1.3.1 A]

•

Labels must be closely and visually associated with the input
field [Best Practice]

•

Error Messages must be associated with the input field
[WCAG 1.3.1 A]

•

Do not use color alone to indicate differences between fields
[WCAG 1.4.1 A]
–

•

Required/Optional Fields, Error Fields

Color Contrast between controls, labels, instructions, errors
and the background must be sufficient [WCAG 1.4.3 AA]
Common Success Criteria
Operable
•

Error messages that apply to the whole form must be
announced automatically [WCAG 2.4.3 A]

•

Instructions that update/change dynamically must be
announced automatically [WCAG 2.4.3 A]

•

If you take action that allows the sighted mouse user to
quickly identify and deal with fields that are in error, then an
equivalent mechanism should be provided for keyboard users
[WCAG 2.1.1 A]

•

No Keyboard trap [WCAG 2.1.2 A]
Common Success Criteria
Operable
•

Focus order [WCAG 2.4.3 A]

•

Focus Visible [WCAG 2.4.7 AA]

•

Everything must be operable with the keyboard [WCAG 2.1.1
A]
Common Success Criteria
Understandable
•

On focus [WCAG 3.2.1 A]

•

On input [WCAG 3.2.2 A]

•

Error Suggestion [WCAG 3.3.3 AA]

•

Error prevention (Legal, Financial, Test data) [WCAG 3.3.4
AA]
Common Success Criteria
Robust
•

Name, Role, Value and State [WCAG 4.1.2 A]
Labels
Simple Labels
•

Use for-id association
<label for=“myinputid”>Label Text</label>
<input id=“myinputid” type=“text” />

•

Use aria-labelledby
<label id=“mylabelid”>Label Text</label>
<input aria-labelledby=“mylabelid” type=“text” />

•

Use label wrapping
<label for=“myinputid”>Label Text
<input id=“myinputid” type=“text” />
</label>

•

Example
Labels
Simple Labels
•

Use aria-label and/or title (beware)
<input id=“search” type=“text” arialabel=“Search”placeholder=“Search”/><button>Search</button>
–

•

or
<input id=“search” type=“text”
title=“Search”placeholder=“Search”/><button>Search</button>

Example
Labels
Multiple Labels
•

Groups - fieldset
<fieldset>
<legend>Social Security Number</legend>
<input type="text" name="ssn1" id="ssn1” title="first three
digits"/> <input type="text" name="ssn2" id="ssn2” title="middle two
digits"/> <input type="text" name="ssn3" id="ssn3” title="last four
digits"/>
</fieldset>

•

Example
Labels
Multiple Labels
•

Groups – aria-labelledby
<span id=“gender-group”>Gender</span>
<input aria-labelledby=“gender-group male-gender”
name=“gender” value=“male” type=“radio” />
<label id=“male-gender”>Male</label>
<input aria-labelledby=“gender-group female-gender”
name=“gender” value=“female” type=“radio” />
<label id=“female-gender”>Female</label>

•

Example
Instructions
Advisory Text, Additional Text…
•

aria-describedby
<p>
<label for=“mybirthdateid”>Date of Birth</label>
<input id=“mybirthdateid” type=“text” aria-describedby=“datefmt”/>
<span id=“datefmt”>format: dd/mm/yyyy</span>
</p>

•

Example
Layout
Locate related items close to one another
•

Labels to input fields

•

Error messages to input fields

•

Instructional text/help icons to input fields
Layout
Layout
Layout
Layout
Layout
Layout
Maintain natural DOM order
•

Do not use tabindex

•

Do not use unnecessary JavaScript focus management in forms

Example
Dynamism
On Focus/Blur
•

Often used to show additional instructions
–

•

Use aria-live and related attributes to announce changes

Often used to do form validation
–
–

•

Use blur to recapture focus into field if it fails to validate (do not create a
keyboard trap)
Use aria-live to announce errors

Sometimes used to add fields
–

Use interim “busy” modal to trap and manage focus
Dynamism
On Change/Input
•

Do not auto advance multi-part fields (e.g. SSN, Date, Phone
number)*

•

Use the modal focus trapping technique if modifying the form

•

Be aware that updates to labels and aria-describedby fields
do not auto announce
–

Use aria-live

Example – Good and Bad
Dynamism
jQuery Animations
•

Error Messages must be in the DOM and visible when the
appropriate field receives focus

•

Form fields must be in the DOM, visible and enabled in order
to receive focus programmatically

•

iOS focus management requires waiting a full second after
show before an element can receive focus
Controls
Use native controls where available
•

<button> or <input type=“submit|image” > and not <a>

•

Use standard radio buttons if possible

•

Conditional use of HTML5 new input types (iOS)
–

•

Date, Slider etc.

Avoid use of “retrofit roles”
–

role=“button”

–

role=“checkbox”

–

role=“textbox”

–

role=“radio”

Example
Validation Fundamentals
Be consistent
•

Choose either automatic validation or validation on
submission

•

Choose one of:
–

Telling users which fields are required

–

Telling users which fields are optional

•

Consistent layout and visual design

•

Consistent markup!!
Error Layout and Navigation
Structure
•

Ensure error messages are visually distinct

•

Ensure error messages are visually associated with the input
field(s)
–
–

•

Cognitive disabilities
Zoom users

Ensure that attention is drawn to the items that are in error
–

–

•

Submission: Either focus on first field or focus on error summary

Auto: revert focus to the field that is in error (do not create a keyboard
trap)

In large forms, make navigation between fields that are inerror easy
–

Keyboard navigation and mouse navigation
Layout
Layout
Error Messages
Structure
•

Ensure that error messages are programmatically associated
with the input field
–

Use techniques previously mentioned

•

Ensure that form-wide error information either receives focus
on validation failure (submission only) or is announced
automatically

•

Ensure that error messages are easy to understand

•

If validation occurs on submission, validate all form fields at
once and provide a summary of all the errors in a summary

Final Example
Questions

dylan.barrell@deque.com
http://www.deque.com/
@dylanbarrell
@unobfuscator
http://unobfuscated.blogspot.com/

Más contenido relacionado

La actualidad más candente

Android application structure
Android application structureAndroid application structure
Android application structureAlexey Ustenko
 
Coding standards
Coding standardsCoding standards
Coding standardsMimoh Ojha
 
Angular 8
Angular 8 Angular 8
Angular 8 Sunil OS
 
Constructor in Java - ITVoyagers
Constructor in Java - ITVoyagersConstructor in Java - ITVoyagers
Constructor in Java - ITVoyagersITVoyagers
 
Introduction to Node js
Introduction to Node jsIntroduction to Node js
Introduction to Node jsAkshay Mathur
 
Introduction to Spring's Dependency Injection
Introduction to Spring's Dependency InjectionIntroduction to Spring's Dependency Injection
Introduction to Spring's Dependency InjectionRichard Paul
 
Flutter presentation.pptx
Flutter presentation.pptxFlutter presentation.pptx
Flutter presentation.pptxFalgunSorathiya
 
20180518 QNAP Seminar - Introduction to React Native
20180518 QNAP Seminar - Introduction to React Native20180518 QNAP Seminar - Introduction to React Native
20180518 QNAP Seminar - Introduction to React NativeEric Deng
 
Constructors in java
Constructors in javaConstructors in java
Constructors in javachauhankapil
 
Unit 1 - TypeScript & Introduction to Angular CLI.pptx
Unit 1 - TypeScript & Introduction to Angular CLI.pptxUnit 1 - TypeScript & Introduction to Angular CLI.pptx
Unit 1 - TypeScript & Introduction to Angular CLI.pptxMalla Reddy University
 
Java Tutorial | Java Programming Tutorial | Java Basics | Java Training | Edu...
Java Tutorial | Java Programming Tutorial | Java Basics | Java Training | Edu...Java Tutorial | Java Programming Tutorial | Java Basics | Java Training | Edu...
Java Tutorial | Java Programming Tutorial | Java Basics | Java Training | Edu...Edureka!
 

La actualidad más candente (20)

Android application structure
Android application structureAndroid application structure
Android application structure
 
Introduction to JAVA
Introduction to JAVAIntroduction to JAVA
Introduction to JAVA
 
Flutter
FlutterFlutter
Flutter
 
Coding standards
Coding standardsCoding standards
Coding standards
 
Flutter Intro
Flutter IntroFlutter Intro
Flutter Intro
 
Angular 8
Angular 8 Angular 8
Angular 8
 
Constructor ppt
Constructor pptConstructor ppt
Constructor ppt
 
Introduction to spring boot
Introduction to spring bootIntroduction to spring boot
Introduction to spring boot
 
Constructor in Java - ITVoyagers
Constructor in Java - ITVoyagersConstructor in Java - ITVoyagers
Constructor in Java - ITVoyagers
 
Java features
Java featuresJava features
Java features
 
what is java?
  what is java?  what is java?
what is java?
 
Java Object Oriented Programming
Java Object Oriented Programming Java Object Oriented Programming
Java Object Oriented Programming
 
Introduction to Node js
Introduction to Node jsIntroduction to Node js
Introduction to Node js
 
Introduction to Spring's Dependency Injection
Introduction to Spring's Dependency InjectionIntroduction to Spring's Dependency Injection
Introduction to Spring's Dependency Injection
 
Flutter presentation.pptx
Flutter presentation.pptxFlutter presentation.pptx
Flutter presentation.pptx
 
20180518 QNAP Seminar - Introduction to React Native
20180518 QNAP Seminar - Introduction to React Native20180518 QNAP Seminar - Introduction to React Native
20180518 QNAP Seminar - Introduction to React Native
 
Angular Directives
Angular DirectivesAngular Directives
Angular Directives
 
Constructors in java
Constructors in javaConstructors in java
Constructors in java
 
Unit 1 - TypeScript & Introduction to Angular CLI.pptx
Unit 1 - TypeScript & Introduction to Angular CLI.pptxUnit 1 - TypeScript & Introduction to Angular CLI.pptx
Unit 1 - TypeScript & Introduction to Angular CLI.pptx
 
Java Tutorial | Java Programming Tutorial | Java Basics | Java Training | Edu...
Java Tutorial | Java Programming Tutorial | Java Basics | Java Training | Edu...Java Tutorial | Java Programming Tutorial | Java Basics | Java Training | Edu...
Java Tutorial | Java Programming Tutorial | Java Basics | Java Training | Edu...
 

Destacado

Javascript validation karan chanana
Javascript validation karan chananaJavascript validation karan chanana
Javascript validation karan chananakaranchanan
 
Javascript validation assignment
Javascript validation assignmentJavascript validation assignment
Javascript validation assignmentH K
 
Client-Side Performance Testing
Client-Side Performance TestingClient-Side Performance Testing
Client-Side Performance TestingAnand Bagmar
 
Patterns of a “good” test automation framework
Patterns of a “good” test automation frameworkPatterns of a “good” test automation framework
Patterns of a “good” test automation frameworkAnand Bagmar
 
The What, Why and How of (Web) Analytics Testing (Web, IoT, Big Data)
The What, Why and How of (Web) Analytics Testing (Web, IoT, Big Data)The What, Why and How of (Web) Analytics Testing (Web, IoT, Big Data)
The What, Why and How of (Web) Analytics Testing (Web, IoT, Big Data)Anand Bagmar
 

Destacado (6)

Javascript validation karan chanana
Javascript validation karan chananaJavascript validation karan chanana
Javascript validation karan chanana
 
Javascript validation assignment
Javascript validation assignmentJavascript validation assignment
Javascript validation assignment
 
Form Validation
Form ValidationForm Validation
Form Validation
 
Client-Side Performance Testing
Client-Side Performance TestingClient-Side Performance Testing
Client-Side Performance Testing
 
Patterns of a “good” test automation framework
Patterns of a “good” test automation frameworkPatterns of a “good” test automation framework
Patterns of a “good” test automation framework
 
The What, Why and How of (Web) Analytics Testing (Web, IoT, Big Data)
The What, Why and How of (Web) Analytics Testing (Web, IoT, Big Data)The What, Why and How of (Web) Analytics Testing (Web, IoT, Big Data)
The What, Why and How of (Web) Analytics Testing (Web, IoT, Big Data)
 

Similar a Accessible Dynamic Forms with jQuery Validation

Toolkit for the Digital Accessibility Space
Toolkit for the Digital Accessibility SpaceToolkit for the Digital Accessibility Space
Toolkit for the Digital Accessibility Space3Play Media
 
Dive Into Mobile - Guidelines for Testing, Native and Web Apps
Dive Into Mobile - Guidelines for Testing, Native and Web AppsDive Into Mobile - Guidelines for Testing, Native and Web Apps
Dive Into Mobile - Guidelines for Testing, Native and Web AppsSusan Hewitt
 
#42 green lantern framework
#42   green lantern framework#42   green lantern framework
#42 green lantern frameworkSrilu Balla
 
Accessibility: Navigation, Forms, & Multimedia
Accessibility: Navigation, Forms, & MultimediaAccessibility: Navigation, Forms, & Multimedia
Accessibility: Navigation, Forms, & MultimediaKlara Schmitt
 
Creating a Great XPages User Interface
Creating a Great XPages User InterfaceCreating a Great XPages User Interface
Creating a Great XPages User InterfaceTeamstudio
 
Creating a Great XPages User Interface, TLCC Teamstudio Webinar - Feb, 2014
Creating a Great XPages User Interface, TLCC Teamstudio Webinar - Feb, 2014Creating a Great XPages User Interface, TLCC Teamstudio Webinar - Feb, 2014
Creating a Great XPages User Interface, TLCC Teamstudio Webinar - Feb, 2014Howard Greenberg
 
Accessibility in Design systems - the pain and glory
Accessibility in Design systems - the pain and gloryAccessibility in Design systems - the pain and glory
Accessibility in Design systems - the pain and gloryRuss Weakley
 
Mastering Test Automation: How to Use Selenium Successfully
Mastering Test Automation: How to Use Selenium Successfully Mastering Test Automation: How to Use Selenium Successfully
Mastering Test Automation: How to Use Selenium Successfully Applitools
 
Accessibility and universal usability
Accessibility and universal usabilityAccessibility and universal usability
Accessibility and universal usabilitySarah Hudson
 
How to use selenium successfully
How to use selenium successfullyHow to use selenium successfully
How to use selenium successfullyTEST Huddle
 
A Toolkit for Digital Accessibility
A Toolkit for Digital Accessibility A Toolkit for Digital Accessibility
A Toolkit for Digital Accessibility 3Play Media
 
1.3.5 more than autocomplete
1.3.5 more than autocomplete1.3.5 more than autocomplete
1.3.5 more than autocompleteJohn Foliot
 
Accessibility - A feature you can build
Accessibility - A feature you can buildAccessibility - A feature you can build
Accessibility - A feature you can buildMonika Piotrowicz
 
Testable Requirements
Testable Requirements Testable Requirements
Testable Requirements Bharti Rupani
 
FlexNet Delivery and FlexNet Operations On-Demand Tips & Tricks
FlexNet Delivery and FlexNet Operations On-Demand Tips & TricksFlexNet Delivery and FlexNet Operations On-Demand Tips & Tricks
FlexNet Delivery and FlexNet Operations On-Demand Tips & TricksFlexera
 

Similar a Accessible Dynamic Forms with jQuery Validation (20)

Toolkit for the Digital Accessibility Space
Toolkit for the Digital Accessibility SpaceToolkit for the Digital Accessibility Space
Toolkit for the Digital Accessibility Space
 
Dive Into Mobile - Guidelines for Testing, Native and Web Apps
Dive Into Mobile - Guidelines for Testing, Native and Web AppsDive Into Mobile - Guidelines for Testing, Native and Web Apps
Dive Into Mobile - Guidelines for Testing, Native and Web Apps
 
#42 green lantern framework
#42   green lantern framework#42   green lantern framework
#42 green lantern framework
 
Accessibility: Navigation, Forms, & Multimedia
Accessibility: Navigation, Forms, & MultimediaAccessibility: Navigation, Forms, & Multimedia
Accessibility: Navigation, Forms, & Multimedia
 
Creating a Great XPages User Interface
Creating a Great XPages User InterfaceCreating a Great XPages User Interface
Creating a Great XPages User Interface
 
Creating a Great XPages User Interface, TLCC Teamstudio Webinar - Feb, 2014
Creating a Great XPages User Interface, TLCC Teamstudio Webinar - Feb, 2014Creating a Great XPages User Interface, TLCC Teamstudio Webinar - Feb, 2014
Creating a Great XPages User Interface, TLCC Teamstudio Webinar - Feb, 2014
 
Sitecore code review checklist
Sitecore code review checklistSitecore code review checklist
Sitecore code review checklist
 
Accessibility in Design systems - the pain and glory
Accessibility in Design systems - the pain and gloryAccessibility in Design systems - the pain and glory
Accessibility in Design systems - the pain and glory
 
Mastering Test Automation: How to Use Selenium Successfully
Mastering Test Automation: How to Use Selenium Successfully Mastering Test Automation: How to Use Selenium Successfully
Mastering Test Automation: How to Use Selenium Successfully
 
Accessibility and universal usability
Accessibility and universal usabilityAccessibility and universal usability
Accessibility and universal usability
 
How to use selenium successfully
How to use selenium successfullyHow to use selenium successfully
How to use selenium successfully
 
Functional UI Testing
Functional UI TestingFunctional UI Testing
Functional UI Testing
 
A Toolkit for Digital Accessibility
A Toolkit for Digital Accessibility A Toolkit for Digital Accessibility
A Toolkit for Digital Accessibility
 
Oracle Apps - Forms
Oracle Apps - FormsOracle Apps - Forms
Oracle Apps - Forms
 
1.3.5 more than autocomplete
1.3.5 more than autocomplete1.3.5 more than autocomplete
1.3.5 more than autocomplete
 
Accessibility - A feature you can build
Accessibility - A feature you can buildAccessibility - A feature you can build
Accessibility - A feature you can build
 
Testable requirements
Testable requirementsTestable requirements
Testable requirements
 
Testable Requirements
Testable Requirements Testable Requirements
Testable Requirements
 
Ooad
OoadOoad
Ooad
 
FlexNet Delivery and FlexNet Operations On-Demand Tips & Tricks
FlexNet Delivery and FlexNet Operations On-Demand Tips & TricksFlexNet Delivery and FlexNet Operations On-Demand Tips & Tricks
FlexNet Delivery and FlexNet Operations On-Demand Tips & Tricks
 

Último

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 

Último (20)

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 

Accessible Dynamic Forms with jQuery Validation

  • 1. Accessible Dynamic Forms and Form Validation with jQuery Dylan Barrell (@dylanbarrell) Vice President of Product Development October, 2013
  • 2. Examples and Code • GitHub Repository with Examples – https://github.com/dylanb/a11yvalid • Uses a11yfy code – https://github.com/dylanb/a11yfy
  • 3. Overview • Commonly Violated WCAG 2.0 (A, AA) SC • Form Accessibility Fundamentals – – Instructions – Layout – Dynamism – • Labels Controls Validation Fundamentals – Fundamentals – Layout and navigation – Error messages and summaries
  • 4. Common Success Criteria Perceivable • All labels must be programmatically associated with the input field [WCAG 1.3.1 A] • Labels must be closely and visually associated with the input field [Best Practice] • Error Messages must be associated with the input field [WCAG 1.3.1 A] • Do not use color alone to indicate differences between fields [WCAG 1.4.1 A] – • Required/Optional Fields, Error Fields Color Contrast between controls, labels, instructions, errors and the background must be sufficient [WCAG 1.4.3 AA]
  • 5. Common Success Criteria Operable • Error messages that apply to the whole form must be announced automatically [WCAG 2.4.3 A] • Instructions that update/change dynamically must be announced automatically [WCAG 2.4.3 A] • If you take action that allows the sighted mouse user to quickly identify and deal with fields that are in error, then an equivalent mechanism should be provided for keyboard users [WCAG 2.1.1 A] • No Keyboard trap [WCAG 2.1.2 A]
  • 6. Common Success Criteria Operable • Focus order [WCAG 2.4.3 A] • Focus Visible [WCAG 2.4.7 AA] • Everything must be operable with the keyboard [WCAG 2.1.1 A]
  • 7. Common Success Criteria Understandable • On focus [WCAG 3.2.1 A] • On input [WCAG 3.2.2 A] • Error Suggestion [WCAG 3.3.3 AA] • Error prevention (Legal, Financial, Test data) [WCAG 3.3.4 AA]
  • 8. Common Success Criteria Robust • Name, Role, Value and State [WCAG 4.1.2 A]
  • 9. Labels Simple Labels • Use for-id association <label for=“myinputid”>Label Text</label> <input id=“myinputid” type=“text” /> • Use aria-labelledby <label id=“mylabelid”>Label Text</label> <input aria-labelledby=“mylabelid” type=“text” /> • Use label wrapping <label for=“myinputid”>Label Text <input id=“myinputid” type=“text” /> </label> • Example
  • 10. Labels Simple Labels • Use aria-label and/or title (beware) <input id=“search” type=“text” arialabel=“Search”placeholder=“Search”/><button>Search</button> – • or <input id=“search” type=“text” title=“Search”placeholder=“Search”/><button>Search</button> Example
  • 11. Labels Multiple Labels • Groups - fieldset <fieldset> <legend>Social Security Number</legend> <input type="text" name="ssn1" id="ssn1” title="first three digits"/> <input type="text" name="ssn2" id="ssn2” title="middle two digits"/> <input type="text" name="ssn3" id="ssn3” title="last four digits"/> </fieldset> • Example
  • 12. Labels Multiple Labels • Groups – aria-labelledby <span id=“gender-group”>Gender</span> <input aria-labelledby=“gender-group male-gender” name=“gender” value=“male” type=“radio” /> <label id=“male-gender”>Male</label> <input aria-labelledby=“gender-group female-gender” name=“gender” value=“female” type=“radio” /> <label id=“female-gender”>Female</label> • Example
  • 13. Instructions Advisory Text, Additional Text… • aria-describedby <p> <label for=“mybirthdateid”>Date of Birth</label> <input id=“mybirthdateid” type=“text” aria-describedby=“datefmt”/> <span id=“datefmt”>format: dd/mm/yyyy</span> </p> • Example
  • 14. Layout Locate related items close to one another • Labels to input fields • Error messages to input fields • Instructional text/help icons to input fields
  • 20. Layout Maintain natural DOM order • Do not use tabindex • Do not use unnecessary JavaScript focus management in forms Example
  • 21. Dynamism On Focus/Blur • Often used to show additional instructions – • Use aria-live and related attributes to announce changes Often used to do form validation – – • Use blur to recapture focus into field if it fails to validate (do not create a keyboard trap) Use aria-live to announce errors Sometimes used to add fields – Use interim “busy” modal to trap and manage focus
  • 22. Dynamism On Change/Input • Do not auto advance multi-part fields (e.g. SSN, Date, Phone number)* • Use the modal focus trapping technique if modifying the form • Be aware that updates to labels and aria-describedby fields do not auto announce – Use aria-live Example – Good and Bad
  • 23. Dynamism jQuery Animations • Error Messages must be in the DOM and visible when the appropriate field receives focus • Form fields must be in the DOM, visible and enabled in order to receive focus programmatically • iOS focus management requires waiting a full second after show before an element can receive focus
  • 24. Controls Use native controls where available • <button> or <input type=“submit|image” > and not <a> • Use standard radio buttons if possible • Conditional use of HTML5 new input types (iOS) – • Date, Slider etc. Avoid use of “retrofit roles” – role=“button” – role=“checkbox” – role=“textbox” – role=“radio” Example
  • 25. Validation Fundamentals Be consistent • Choose either automatic validation or validation on submission • Choose one of: – Telling users which fields are required – Telling users which fields are optional • Consistent layout and visual design • Consistent markup!!
  • 26. Error Layout and Navigation Structure • Ensure error messages are visually distinct • Ensure error messages are visually associated with the input field(s) – – • Cognitive disabilities Zoom users Ensure that attention is drawn to the items that are in error – – • Submission: Either focus on first field or focus on error summary Auto: revert focus to the field that is in error (do not create a keyboard trap) In large forms, make navigation between fields that are inerror easy – Keyboard navigation and mouse navigation
  • 29. Error Messages Structure • Ensure that error messages are programmatically associated with the input field – Use techniques previously mentioned • Ensure that form-wide error information either receives focus on validation failure (submission only) or is announced automatically • Ensure that error messages are easy to understand • If validation occurs on submission, validate all form fields at once and provide a summary of all the errors in a summary Final Example

Notas del editor

  1. [Do we want a fed graphic or photo here?][TYLER: If you do want an image, can you let me know if “fed” just means government in this context?]
  2. Although this is the currently preferred method for group labels, it is subject to differing implementations from AT to AT and some ATs have chosen to implement this in an irritating fashion (e.g. JAWS will announce the group label when focus moves to every sub-field, whereas NVDA will only do this on the first field in the group)
  3. Allows for more consistent support by Ats (controllable by you) but is not as widely supported by AT
  4. Be aware – bugs exist in combined use of aria-live and aria-describedby
  5. If you must use animations, then just be aware of the issues they create and work around them
  6. Consistency is one of the most important attributes of a site or application in order to make it easy to use.Remember, visual consistency does not equal consistency from a perspective of accessibility – consistent markup is as important as consistent visual layout. For example, if something looks like a button and is marked up as a button the first time and looks the same but is marked up as an anchor the second time, this can cause users to waste time, repeat commands and/or get confused.
  7. A user who is sighted should be able to immediately identify the fields that are in error as distinct from those that are not. Remember to not use color alone, use icons too or flip the background and foreground (light on dark vs. dark on light)Make sure it is unambiguous as to which field the error belongs to and make sure that this connection is discernable easily when using a screen magnifierTo assist users with cognitive disabilities and blind users, draw focus immediately to the first field that is in error and/or the summary if validation is done on submission. If validation is done automatically, then draw the focus back to the first field in error
  8. Use the techniques described previously to associate the error messages with the input fields. In order of preference, make them part of the label first and if that is not possible due to the markup, add them as a hint through aria-describedby.Making error messages easy to understand involves at least: 1) making sure that the reading level required to understand it is appropriate, and 2) that if the error was due to content format or content rather than the omission of a required field, that additional information be supplied about the reason the format or content was not valid (remember to not compromise security)