SlideShare a Scribd company logo
1 of 104
Download to read offline
Web Forms
 People
Don’t Hate

 Chris Lienert
  @cliener
Ooh!
Double Negative!
Love
Ooh!
   EotW
Double Negative!
End of the World
I work for Jardine Lloyd Thompson
Who used to smuggle opium
Insurance means forms
And forms
And more forms
Imagine filling that out online
Or on your mobile
Design Patterns




http://www.lukew.com/resources/web_form_design.asp
Design Patterns

Vertical label/field
Vertical Label/Field
Design Patterns

Vertical label/field
Horizontal (search)
Horizontal (Search)
Design Patterns

Vertical label/field
Horizontal (search)
Clear path to completion
Clear Path to Completion
Design Patterns

Vertical label/field
Horizontal (search)
Clear path to completion
Mark optional fields
Mark Optional Fields
Don’t do this
Build

Form
Build

Form
Fieldset
Build

Form
Fieldset
[no caption]
Build

Form
Fieldset
[no caption]
Block element (p, li, th, td)
Build

Form
Fieldset
[no caption]
Block element (p, li, th, td)
Label (id)
Build

Form
Fieldset
[no caption]
Block element (p, li, th, td)
Label (id)
Field
Build

<form	
  method="post"	
  action="wds.aspx">
<fieldset>
<p><label	
  for="name">Name</label>	
  <input	
  
type="text"	
  name="name"	
  id="name"></p>
</fieldset>
</form>
HTML5 Forms




http://wufoo.com/html5
HTML5 Attributes

maxlength for TextArea
HTML5 Attributes

maxlength for TextArea
required
HTML5 Attributes

maxlength for TextArea
required
placeholder
HTML5 Attributes

maxlength for TextArea
required
placeholder
autocorrect="off "
HTML5 Attributes

maxlength for TextArea
required
placeholder
autocorrect="off "
autocapitalize="off "
HTML5 Attributes

maxlength for TextArea
required
placeholder
autocorrect="off "
autocapitalize="off "
autofocus
Autofocus in Practice – Type…
Autofocus in Practice – Type…
Autofocus in Practice – Argh!
Autofocus in Practice – Argh!




 F IX E D !
HTML5 Attributes

Pattern
 • default error messages
   are awful
 • doesn't scale well
 • does a fine robot dance
HTML5 Attributes

Pattern
 • pattern="/d*"
HTML5 Input Types

Email
 • instant win
 • iOS keyboard love
HTML5 Input Types

Date, Month, Week, Time
 • don’t
HTML5 Input Types
HTML5 Input Types

Tel
 • fairly useless
 • iOS keyboard love
People get things wrong
Validation to the rescue!
You Wouldn’t Like Me When I’m Angry
Validate Early,Validate Often

Allow people to make mistakes
Allow People to Make Mistakes
Allow People to Make Mistakes
Allow People to Make Mistakes

  “The real danger is not that
computers will begin to think like
 men, but that men will begin to
     think like computers.”
         Sydney J Harris
Allow People to Make Mistakes
Validate Early,Validate Often

Allow people to make mistakes
Clearly mark invalid fields
Clearly Mark Invalid Fields
Clearly Mark Invalid Fields

<p><label	
  for="birth-­‐date">Birth	
  Date</
label>	
  <input	
  type="text"	
  class="date"	
  
name="birth-­‐date"	
  id="birth-­‐date"	
  
required></p>
Clearly Mark Invalid Fields

<p><label	
  for="birth-­‐date">Birth	
  Date</
label>	
  <input	
  type="text"	
  class="date"	
  
name="birth-­‐date"	
  id="birth-­‐date"	
  
required	
  aria-­‐invalid="true">	
  
<label	
  for="birth_date"	
  class="errata"	
  
role="alert">Please	
  enter	
  a	
  value</
label></p>
Validate Early,Validate Often

Allow people to make mistakes
Clearly mark invalid fields
Pattern validate on entry
Pattern Validate on Entry
Validate Early,Validate Often

Allow people to make mistakes
Clearly mark invalid fields
Pattern validate on entry
Enforce minimum not maximum
Enforce Minimum not Maximum
Enforce Minimum not Maximum
Distraction




http://bit.ly/Oaqlre
Validate Early,Validate Often

Allow people to make mistakes
Clearly mark invalid fields
Pattern validate on entry
Enforce minimum not maximum
Get it right
Get it Right
A Bunch of Malarkey
Special Exhibit
Special Exhibit
Special Exhibit
Build
Build
Build
Build




        Lots of coding
Build
Quaid JS

Embrace & extend HTML, DOM
Quaid JS

Embrace & extend HTML, DOM
Polyfill older browsers
Embrace and Extend

Tel
 • phone
  <input	
  type="tel"	
  class="phone">

 • mobile
  <input	
  type="tel"	
  class="mobile">
Embrace and Extend

Postcode
 • data-­‐state-­‐field
<input	
  type="text"	
  class="postcode"	
  data-­‐
state-­‐field="state">

<select	
  id="state"	
  name="state">…</	
  
select>
Embrace and Extend

Time
<input	
  type="text"	
  class="time">

Date
<input	
  type="text"	
  class="date">

Year
<input	
  type="text"	
  class="year">
Embrace and Extend

Numeric
<input	
  type="text"	
  class="numeric">

Integer
<input	
  type="text"	
  class="integer">

Currency
<input	
  type="text"	
  class="currency">
Embrace and Extend

Positive Numeric
<input	
  type="text"	
  class="positive_numeric">

Positive Integer
<input	
  type="text"	
  class="positive_integer">

Positive Currency
<input	
  type="text"	
  class="positive_currency">
Embrace and Extend

Credit Card
<input	
  type="text"	
  class="credit_card">

CSC
<input	
  type="text"	
  class="csc">
Data Attributes

Required if
<input	
  type="checkbox"	
  name="variable-­‐
field"	
  id="variable-­‐field">
…
<input	
  type="text"	
  name="target-­‐field"	
  
id="target-­‐field"	
  data-­‐required-­‐
field="variable-­‐field">
Data Attributes

Visible if
<input	
  type="checkbox"	
  name="variable-­‐
field"	
  id="variable-­‐field">
…
<p	
  data-­‐visible-­‐field="variable-­‐field">…
</p>
Custom Validation

Inline
$("#field").addValidation(function	
  (el)	
  {
	
  	
  if	
  (!(el.isValid	
  =	
  !el.checked))	
  {
	
  	
  	
  	
  el.errorMessage	
  =	
  "Check	
  the	
  box	
  or	
  
else.";
	
  	
  }
});
Custom Validation

On Submit
$("#field").addSubmitValidation(function	
  
(el)	
  {
	
  	
  if	
  (!(el.isValid	
  =	
  !el.checked))	
  {
	
  	
  	
  	
  el.errorMessage	
  =	
  "Check	
  the	
  box	
  or	
  
else.	
  Really.";
	
  	
  }
});
Custom Validation

Ajax Server Call
$("#postcode").addServerValidation({
	
  	
  path:	
  "validation.svc/IsValidPostcode?
postcode="
})
Custom Validation

Ajax Service
public	
  ValidationResponse	
  IsValidPostcode(string	
  
postcode,	
  string	
  caller)
{
	
  	
  	
  	
  using	
  (var	
  p	
  =	
  new	
  PostalAddressClient())
	
  	
  	
  	
  {
	
  	
  	
  	
  	
  	
  	
  	
  if	
  (!string.IsNullOrEmpty(postcode)	
  &&	
  !
p.IsValidPostcode(postcode))
	
  	
  	
  	
  	
  	
  	
  	
  {
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  …
}
Custom Validation

Ajax Service
public	
  ValidationResponse	
  IsValidPostcode(…)
{
	
  	
  	
  	
  	
  	
  	
  	
  …
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  return	
  new	
  ValidationResponse(…,	
  
caller);
	
  	
  	
  	
  	
  	
  	
  	
  }
	
  	
  	
  	
  }
	
  	
  	
  	
  return	
  new	
  ValidationResponse(string.Empty,	
  
caller);
}
Custom Validation

Ajax Response
>	
  validationResponse	
  {
	
  	
  message:	
  "",
	
  	
  caller:	
  "postcode"
}
Plug-in Internationalisation

Custom methods and errors
quaid.forms-au-4.0.js
message:	
  {	
  required:	
  
	
  	
  "Value	
  not	
  entered"	
  }


quaid.forms-ca-4.0.js
message:	
  {	
  required:	
  
	
  "Value	
  not	
  entered,	
  eh.	
  Go	
  Leafs!"	
  }
Elephant in the Room
Elephant in the Room




                   6+
And the Rest



6+         3.6+
When the Lights Go Down

JavaScript
HTML5
Server
<label	
  class="server-­‐error">
Ready for the Taking




https://github.com/cliener/Quaid-JS
On a Web Site Near You




http://physical.jltsport.com.au
Plug




http://www.netmagazine.com/shop/magazines/april-2013-239
Standing on the Shoulders of Giants
Wufoo
The Current State of HTML5 Forms
http://wufoo.com/html5/

Luke W
Web Form Design: Filling in the Blanks
http://www.lukew.com/resources/web_form_design.asp
Evolving E-commerce Checkout
http://www.lukew.com/ff/entry.asp?1579
Standing on the Shoulders of Giants
Steve Krug
Don't Make Me Think
http://www.sensible.com/dmmt.html

Punkchip
WAI-ARIA to enhance form validation
http://www.punkchip.com/2010/12/aria-enhance-
form-validation/

More Related Content

What's hot

HTML5 Forms - KISS time - Fronteers
HTML5 Forms - KISS time - FronteersHTML5 Forms - KISS time - Fronteers
HTML5 Forms - KISS time - Fronteers
Robert Nyman
 

What's hot (20)

PLAT-14 Forms Config, Customization, and Extension
PLAT-14 Forms Config, Customization, and ExtensionPLAT-14 Forms Config, Customization, and Extension
PLAT-14 Forms Config, Customization, and Extension
 
jQuery Presentation to Rails Developers
jQuery Presentation to Rails DevelopersjQuery Presentation to Rails Developers
jQuery Presentation to Rails Developers
 
Alfresco Forms Service Deep Dive
Alfresco Forms Service Deep DiveAlfresco Forms Service Deep Dive
Alfresco Forms Service Deep Dive
 
Page Caching Resurrected
Page Caching ResurrectedPage Caching Resurrected
Page Caching Resurrected
 
Stole16
Stole16Stole16
Stole16
 
Seasion5
Seasion5Seasion5
Seasion5
 
HTML5 Forms - KISS time - Fronteers
HTML5 Forms - KISS time - FronteersHTML5 Forms - KISS time - Fronteers
HTML5 Forms - KISS time - Fronteers
 
Html5 structure tags
Html5 structure tagsHtml5 structure tags
Html5 structure tags
 
The Features of Highly Effective Forms [An Event Apart Nashville 2016]
The Features of Highly Effective Forms [An Event Apart Nashville 2016]The Features of Highly Effective Forms [An Event Apart Nashville 2016]
The Features of Highly Effective Forms [An Event Apart Nashville 2016]
 
Testing ASP.net Web Applications using Ruby
Testing ASP.net Web Applications using RubyTesting ASP.net Web Applications using Ruby
Testing ASP.net Web Applications using Ruby
 
Falling in Love with Forms [Microsoft Edge Web Summit 2015]
Falling in Love with Forms [Microsoft Edge Web Summit 2015]Falling in Love with Forms [Microsoft Edge Web Summit 2015]
Falling in Love with Forms [Microsoft Edge Web Summit 2015]
 
SlideShare Instant
SlideShare InstantSlideShare Instant
SlideShare Instant
 
SlideShare Instant
SlideShare InstantSlideShare Instant
SlideShare Instant
 
Session6
Session6Session6
Session6
 
In some simple steps, your site can stand out from the rest. Here's how...
In some simple steps, your site can stand out from the rest. Here's how... In some simple steps, your site can stand out from the rest. Here's how...
In some simple steps, your site can stand out from the rest. Here's how...
 
APIs REST Usables con Hypermedia por Javier Ramirez, para codemotion
APIs REST Usables con Hypermedia por Javier Ramirez, para codemotionAPIs REST Usables con Hypermedia por Javier Ramirez, para codemotion
APIs REST Usables con Hypermedia por Javier Ramirez, para codemotion
 
Html ,css,xml
Html ,css,xmlHtml ,css,xml
Html ,css,xml
 
FYBSC IT Web Programming Unit II Html 5 Tables, Forms and Media
FYBSC IT Web Programming Unit II  Html 5 Tables, Forms and MediaFYBSC IT Web Programming Unit II  Html 5 Tables, Forms and Media
FYBSC IT Web Programming Unit II Html 5 Tables, Forms and Media
 
Stylesheets for Online Help - Scott DeLoach, ClickStart
Stylesheets for Online Help - Scott DeLoach, ClickStartStylesheets for Online Help - Scott DeLoach, ClickStart
Stylesheets for Online Help - Scott DeLoach, ClickStart
 
Web technology
Web technologyWeb technology
Web technology
 

Similar to Web Forms People Don't Hate

HTML5 - The 2012 of the Web - Adobe MAX
HTML5 - The 2012 of the Web - Adobe MAXHTML5 - The 2012 of the Web - Adobe MAX
HTML5 - The 2012 of the Web - Adobe MAX
Robert Nyman
 
HTML5 - The 2012 of the Web
HTML5 - The 2012 of the WebHTML5 - The 2012 of the Web
HTML5 - The 2012 of the Web
Robert Nyman
 
Getting the Most Out of OpenSocial Gadgets
Getting the Most Out of OpenSocial GadgetsGetting the Most Out of OpenSocial Gadgets
Getting the Most Out of OpenSocial Gadgets
Atlassian
 

Similar to Web Forms People Don't Hate (20)

Building & Breaking Web Forms with Quaid-JS
Building & Breaking Web Forms with Quaid-JSBuilding & Breaking Web Forms with Quaid-JS
Building & Breaking Web Forms with Quaid-JS
 
What you need to know bout html5
What you need to know bout html5What you need to know bout html5
What you need to know bout html5
 
Practical PHP by example Jan Leth-Kjaer
Practical PHP by example   Jan Leth-KjaerPractical PHP by example   Jan Leth-Kjaer
Practical PHP by example Jan Leth-Kjaer
 
PHPUnit Episode iv.iii: Return of the tests
PHPUnit Episode iv.iii: Return of the testsPHPUnit Episode iv.iii: Return of the tests
PHPUnit Episode iv.iii: Return of the tests
 
HTML5 - The 2012 of the Web - Adobe MAX
HTML5 - The 2012 of the Web - Adobe MAXHTML5 - The 2012 of the Web - Adobe MAX
HTML5 - The 2012 of the Web - Adobe MAX
 
HTML5 e Css3 - 7 | WebMaster & WebDesigner
HTML5 e Css3 - 7 | WebMaster & WebDesignerHTML5 e Css3 - 7 | WebMaster & WebDesigner
HTML5 e Css3 - 7 | WebMaster & WebDesigner
 
Moving to the client - HTML5 is here
Moving to the client - HTML5 is here Moving to the client - HTML5 is here
Moving to the client - HTML5 is here
 
PHP-04-Forms.ppt
PHP-04-Forms.pptPHP-04-Forms.ppt
PHP-04-Forms.ppt
 
Scti 2011 minicurso jquery
Scti 2011 minicurso jqueryScti 2011 minicurso jquery
Scti 2011 minicurso jquery
 
Leveraging Symfony2 Forms
Leveraging Symfony2 FormsLeveraging Symfony2 Forms
Leveraging Symfony2 Forms
 
Html5
Html5Html5
Html5
 
ApacheCon 2005
ApacheCon 2005ApacheCon 2005
ApacheCon 2005
 
HTML5 - The 2012 of the Web
HTML5 - The 2012 of the WebHTML5 - The 2012 of the Web
HTML5 - The 2012 of the Web
 
Html5 101
Html5 101Html5 101
Html5 101
 
HTML5 Web Forms
HTML5 Web FormsHTML5 Web Forms
HTML5 Web Forms
 
Introduccion a HTML5
Introduccion a HTML5Introduccion a HTML5
Introduccion a HTML5
 
html5
html5html5
html5
 
jQuery Essentials
jQuery EssentialsjQuery Essentials
jQuery Essentials
 
Getting the Most Out of OpenSocial Gadgets
Getting the Most Out of OpenSocial GadgetsGetting the Most Out of OpenSocial Gadgets
Getting the Most Out of OpenSocial Gadgets
 
HTML5
HTML5HTML5
HTML5
 

Recently uploaded

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Recently uploaded (20)

WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 

Web Forms People Don't Hate