SlideShare a Scribd company logo
Todd Anglin
  @toddanglin
@t oddanglin

VP HTML5 Web & Mobile Tools, Telerik
Microsoft MVP, ASP Insider, O'Reilly Author

   htmlui.com
   @htmlui
HTML5 forms & input:
learning goals
•   what’s available?
•   how do you use it?
•   how do you customize the
    default experience?
•   how do you make it work in
    older browsers?
TODAY

HTML FORMS
asdflkajfds
Enter your email: <input type="text" />
<input type="submit" value="Submit" />
In HTML4…
•   Everything’s a text box
•   Lots of JavaScript
<input type="_________" />



 text               checkbox
 password           radio
 hidden             submit
 file               reset
                    image
                    button

HTML4
Wouldn't it be nice if…
•   Browsers understood different
    data types
•   Browsers tailored input
    methods to data types
•   Browsers could do basic
    validation
FORMS
•   New input types
•   New rendering
•   New input features
    – EX: Placeholder Text, AutoFocus



      Backwards compatible!
<input type="_________" />



 text               checkbox
 password           radio
 hidden             submit
 file               reset
                    image
                    button

HTML4
<input type="_________" />



text       url         checkbox
password   search      radio
hidden     color       submit
file       number      reset
email      range       image
tel        datetime*   button

HTML5
HTML5 Mullet: Forms & Input Validation
State of the Browsers
(Mid 2012)



 A      B    A+    B+   B-

 21    11   11.6    6   9
HTML5 Mullet: Forms & Input Validation
HTML5 Mullet: Forms & Input Validation
OS X
HTML5 Mullet: Forms & Input Validation
HTML5 Mullet: Forms & Input Validation
HTML5 Mullet: Forms & Input Validation
HTML5 Mullet: Forms & Input Validation
[No unique keyboard for Date/Time]

    Chrome for Android improves the story,
but only available to fraction of Android users.
DEMO:
NEW INPUT TYPES
"Can I customize browser
   rendered input elements
    (like calendar or range
            slider)?"
             Nope. Not yet. Not really.




     Shadow DOM
input[type=range].custom::-webkit-slider-thumb
HTML5 Mullet: Forms & Input Validation
DEMO:
CUSTOMIZING SHADOW
DOM
asdflkajfds
Enter your email:
<input type="email" placeholder="Enter
your email" required title="Please
enter your email" />
<input type="submit" value="Submit" />
New Attributes
•   More control over input
    behavior
    – Still no JavaScript
    – Improved usability
                        – NoValidate
•   Attributes:         – FormNoValidate
    – Placeholder
                        – Accept
    – Autofocus
                        – Multiple
    – Max Length
                        – Min/Max
    – List
                        – Step
    – AutoComplete
    – Required
    – Pattern
DEMO:
NEW INPUT ATTRIBUTES
Validation
•   Handled by browser
    – Can be disabled via form
      novalidate
•   Saves JavaScript
    – Less to download = faster loading
      apps

    Does not replace server-
        side validation
3 Ways to Control Validation
Customizing validation HTML
 •   Change message
     – In Chrome, use input title attribute
       (Not FF, O, S)
 •   Pattern attribute
JavaScri
Validation API                      pt


  •   JavaScript for greater control


checkValidity() setCustomValidity()
CSS Styling for Validation CSS


  New states:
    valid       in-range
    invalid     out-of-range
    required    ready-only
    optional    write-only
DEMO:
CUSTOMIZING VALIDATION
Lowest common denominator?
       Including IE9?


     NOTHING.
        :(
HTML5 Mullet: Forms & Input Validation
Older Browsers
1.   Polyfill
2.   JavaScript fallbacks
DEMO:
POLYFILLING HTML5 FORMS
HTML5 Mullet: Forms & Input Validation
Please remember to complete and
     return your session eval forms.




@toddanglin | anglin@telerik.com

THANKS!

                          www.KendoUI.com

More Related Content

What's hot (20)

PDF
An Introduction To HTML5
Robert Nyman
 
PDF
HTML5 and the dawn of rich mobile web applications
James Pearce
 
PDF
Dreamweaver CS6, jQuery, PhoneGap, mobile design
Dee Sadler
 
PDF
HTML5 JS APIs
Remy Sharp
 
PDF
Introduction to HTML5
Gil Fink
 
PDF
HTML5 & Friends
Remy Sharp
 
ODP
HTML5
Hatem Mahmoud
 
PPTX
Getting Started with HTML5 in Tech Com (STC 2012)
Peter Lubbers
 
PPTX
HTML5: An Overview
Nagendra Um
 
PDF
HTML5: features with examples
Alfredo Torre
 
KEY
An Introduction to HTML5
Steven Chipman
 
PPTX
Html 5
manujayarajkm
 
PDF
What the heck is HTML 5?
Simon Willison
 
PDF
HTML5 Semantics, Accessibility & Forms [Carsonified HTML5 Online Conference]
Aaron Gustafson
 
PPTX
Html5 Basics
Pankaj Bajaj
 
PPT
HTML5 CSS3 Basics
Srinivas Tamada
 
PPTX
Training HTML5 CSS3 Ilkom IPB
Wahyu Putra
 
PDF
Brave new world of HTML5 - Interlink Conference Vancouver 04.06.2011
Patrick Lauke
 
PDF
The Future of the Web: HTML5
Derek Bender
 
PPTX
What is HTML 5?
Susan Winters
 
An Introduction To HTML5
Robert Nyman
 
HTML5 and the dawn of rich mobile web applications
James Pearce
 
Dreamweaver CS6, jQuery, PhoneGap, mobile design
Dee Sadler
 
HTML5 JS APIs
Remy Sharp
 
Introduction to HTML5
Gil Fink
 
HTML5 & Friends
Remy Sharp
 
Getting Started with HTML5 in Tech Com (STC 2012)
Peter Lubbers
 
HTML5: An Overview
Nagendra Um
 
HTML5: features with examples
Alfredo Torre
 
An Introduction to HTML5
Steven Chipman
 
What the heck is HTML 5?
Simon Willison
 
HTML5 Semantics, Accessibility & Forms [Carsonified HTML5 Online Conference]
Aaron Gustafson
 
Html5 Basics
Pankaj Bajaj
 
HTML5 CSS3 Basics
Srinivas Tamada
 
Training HTML5 CSS3 Ilkom IPB
Wahyu Putra
 
Brave new world of HTML5 - Interlink Conference Vancouver 04.06.2011
Patrick Lauke
 
The Future of the Web: HTML5
Derek Bender
 
What is HTML 5?
Susan Winters
 

Viewers also liked (20)

PPTX
Form Validation in JavaScript
Ravi Bhadauria
 
PDF
A World of Talent: What Perennial NBA Contenders Teach Us About Collaboration
Cureo
 
PPTX
Wpf Validation
RookieOne
 
PDF
JavaScript
Bharti Gupta
 
PPT
Flex security
chengalva
 
PPT
HTML5
Doncho Minkov
 
PDF
Business Interfaces using Virtual Objects, Visual-Force Forms and JavaScript
Salesforce Developers
 
PPTX
Data validation
Qamar Wajid
 
PPTX
02. input validation module v5
Eoin Keary
 
PPTX
Making HTML5 Work Everywhere
Todd Anglin
 
PPT
Building RESTful Applications with OData
Todd Anglin
 
PPTX
Accelerated Adoption: HTML5 and CSS3 for ASP.NET Developers
Todd Anglin
 
PPTX
Javascript validating form
Jesus Obenita Jr.
 
PDF
Using HTML5 to Build Mobile Apps
Todd Anglin
 
PPT
Web forms and server side scripting
sawsan slii
 
PPTX
Data validation in web applications
srkirkland
 
DOCX
Validation rule, validation text and input masks
fizahPhd
 
PPTX
HTML5 Bootcamp: Essential HTML, CSS, & JavaScript
Todd Anglin
 
PPT
Regular Expressions
Satya Narayana
 
PDF
NativeScript: Cross-Platform Mobile Apps with JavaScript and Angular
Todd Anglin
 
Form Validation in JavaScript
Ravi Bhadauria
 
A World of Talent: What Perennial NBA Contenders Teach Us About Collaboration
Cureo
 
Wpf Validation
RookieOne
 
JavaScript
Bharti Gupta
 
Flex security
chengalva
 
Business Interfaces using Virtual Objects, Visual-Force Forms and JavaScript
Salesforce Developers
 
Data validation
Qamar Wajid
 
02. input validation module v5
Eoin Keary
 
Making HTML5 Work Everywhere
Todd Anglin
 
Building RESTful Applications with OData
Todd Anglin
 
Accelerated Adoption: HTML5 and CSS3 for ASP.NET Developers
Todd Anglin
 
Javascript validating form
Jesus Obenita Jr.
 
Using HTML5 to Build Mobile Apps
Todd Anglin
 
Web forms and server side scripting
sawsan slii
 
Data validation in web applications
srkirkland
 
Validation rule, validation text and input masks
fizahPhd
 
HTML5 Bootcamp: Essential HTML, CSS, & JavaScript
Todd Anglin
 
Regular Expressions
Satya Narayana
 
NativeScript: Cross-Platform Mobile Apps with JavaScript and Angular
Todd Anglin
 
Ad

Similar to HTML5 Mullet: Forms & Input Validation (20)

PDF
HTML5 Forms - KISS time - Fronteers
Robert Nyman
 
PPTX
HTML5 Forms OF DOOM
Stephanie Hobson
 
PPTX
html 5 new form attribute
Priyanka Rasal
 
PPT
ch3.ppt
EnghamzaKhalailah
 
PPTX
Html5 inputs
Chris Love
 
PPTX
Web input forms.pptx
SindhuVelmukull
 
PPTX
Forms with html5
Suvarna Pappu
 
PPTX
Forms with html5 (1)
Anada Kale
 
PDF
Html5 Forms in Squiz Matrix - Dave Letorey
Squiz
 
PPTX
Html form tag
shreyachougule
 
PPTX
HTML Forms: The HTML element represents a document section containing interac...
BINJAD1
 
PPT
Web forms and html (lect 4)
Salman Memon
 
PDF
Forms
Aaron Maturen
 
PPTX
Html tables, forms and audio video
Saad Sheikh
 
PPT
05 html-forms
Palakshya
 
PPT
20 html-forms
Kumar
 
PPTX
HTML DAY 4 presentation for beginners friendly
RohitKrishnan32
 
KEY
HTML5 Form Validation
Ian Oxley
 
PPTX
HTML FORMS.pptx
Sierranaijamusic
 
PPTX
New Form Element in HTML5
Zahra Rezwana
 
HTML5 Forms - KISS time - Fronteers
Robert Nyman
 
HTML5 Forms OF DOOM
Stephanie Hobson
 
html 5 new form attribute
Priyanka Rasal
 
Html5 inputs
Chris Love
 
Web input forms.pptx
SindhuVelmukull
 
Forms with html5
Suvarna Pappu
 
Forms with html5 (1)
Anada Kale
 
Html5 Forms in Squiz Matrix - Dave Letorey
Squiz
 
Html form tag
shreyachougule
 
HTML Forms: The HTML element represents a document section containing interac...
BINJAD1
 
Web forms and html (lect 4)
Salman Memon
 
Html tables, forms and audio video
Saad Sheikh
 
05 html-forms
Palakshya
 
20 html-forms
Kumar
 
HTML DAY 4 presentation for beginners friendly
RohitKrishnan32
 
HTML5 Form Validation
Ian Oxley
 
HTML FORMS.pptx
Sierranaijamusic
 
New Form Element in HTML5
Zahra Rezwana
 
Ad

More from Todd Anglin (9)

PPTX
Developing a Modern Mobile App Strategy
Todd Anglin
 
PPTX
5 Tips for Better JavaScript
Todd Anglin
 
PPTX
50in50: Resources for HTML5, CSS3, & JavaScript Developers
Todd Anglin
 
PPTX
HTML5 and CSS3 Techniques You Can Use Today
Todd Anglin
 
PPTX
HTML5 for Tablets and Mobile
Todd Anglin
 
PPTX
Doing More with LESS for CSS
Todd Anglin
 
PPT
Building a Testable Data Access Layer
Todd Anglin
 
PPTX
HTML5 and CSS3 Techniques You Can Use Today
Todd Anglin
 
PPTX
What’s New in ASP.NET 4
Todd Anglin
 
Developing a Modern Mobile App Strategy
Todd Anglin
 
5 Tips for Better JavaScript
Todd Anglin
 
50in50: Resources for HTML5, CSS3, & JavaScript Developers
Todd Anglin
 
HTML5 and CSS3 Techniques You Can Use Today
Todd Anglin
 
HTML5 for Tablets and Mobile
Todd Anglin
 
Doing More with LESS for CSS
Todd Anglin
 
Building a Testable Data Access Layer
Todd Anglin
 
HTML5 and CSS3 Techniques You Can Use Today
Todd Anglin
 
What’s New in ASP.NET 4
Todd Anglin
 

Recently uploaded (20)

PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PDF
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
PDF
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PPT
Interview paper part 3, It is based on Interview Prep
SoumyadeepGhosh39
 
PDF
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PDF
July Patch Tuesday
Ivanti
 
PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PDF
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
PDF
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
Interview paper part 3, It is based on Interview Prep
SoumyadeepGhosh39
 
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
July Patch Tuesday
Ivanti
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 

HTML5 Mullet: Forms & Input Validation

Editor's Notes

  • #2: The HTML5 Mullet: Form Input and Validation Really, it ’s the HTML5 Reverse Mullet. Party in the front, business in the back. Most talk about HTML5 generally revolves around the fun and exciting technologies like Geolocation, Video, and the powerful styling CSS3 brings to the party. But how useful is HTML5 for business apps? HTML5 promises a number of new features in browsers that will make data entry and validation easier for developers and end-users. In this session, you will learn how HTML5 is helping business developers simplify working with data and input validation, and see practical techniques for leveraging these features across all browsers, old and new. You will learn: How to use HTML5 Forms and input validation Techniques for bridging the gap to older browsers that lack HTML5 How to customize the default browser HTML5 Forms experience
  • #3: Visual Studio Live! Las Vegas 2011MGB 2003 © 2003 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
  • #6: This HTML4 form would submit without hesitation, even though the input is clearly wrong. Visual Studio Live! Las Vegas 2011MGB 2003 © 2003 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
  • #7: Configuration for basic input example Visual Studio Live! Las Vegas 2011MGB 2003 © 2003 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
  • #9: http://www.w3.org/TR/html4/interact/forms.html#adef-type-INPUT The &quot;state of the art&quot; for forms in HTML4 Visual Studio Live! Las Vegas 2011MGB 2003 © 2003 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
  • #13: http://www.w3.org/TR/html4/interact/forms.html#adef-type-INPUT Visual Studio Live! Las Vegas 2011MGB 2003 © 2003 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
  • #14: There are 13 new input types Visual Studio Live! Las Vegas 2011MGB 2003 © 2003 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
  • #16: Browsers ultimately dictate the usability of HTML5 forms. Great overview available here: http://wufoo.com/html5/ This non-specific rating focuses on Desktop Browsers. Mobile browsers are a different story. Visual Studio Live! Las Vegas 2011MGB 2003 © 2003 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
  • #17: Most new types still render as a normal textbox Shown: IE9, FF11 LIVE TEST: http://jsbin.com/imonat Visual Studio Live! Las Vegas 2011MGB 2003 © 2003 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
  • #18: Chrome 21 (Mac) Visual Studio Live! Las Vegas 2011MGB 2003 © 2003 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
  • #19: Not only do renderings differ by browser, but by client Visual Studio Live! Las Vegas 2011MGB 2003 © 2003 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
  • #20: iOS varies the keyboard significantly on the iPhone depending on the input type Shown: iOS5 (not available in iOS4) Visual Studio Live! Las Vegas 2011MGB 2003 © 2003 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
  • #24: Android (4.0) also provides unique keyboards, but support is not nearly as extensive for HTML5 input types as iOS Visual Studio Live! Las Vegas 2011MGB 2003 © 2003 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
  • #26: Shadow DOM: http://glazkov.com/2011/01/14/what-the-heck-is-shadow-dom/ Example: input[type=range].custom::-webkit-slider-thumb { -webkit-appearance: none; background-color: Green; opacity: 0.5; width: 10px; height: 40px; } Visual Studio Live! Las Vegas 2011MGB 2003 © 2003 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
  • #33: Validation helps improve user experience. Fewer trips to the server if you can catch simple user mistakes on the client.
  • #35: By default, browser use RFC-compliant email validation Some types, like Telephone intentionally do not validate format http://stackoverflow.com/questions/5272433/html5-form-required-attribute-set-custom-validation-message http://jsfiddle.net/nfgfP/61/
  • #37: http://www.alistapart.com/articles/forward-thinking-form-validation/
  • #39: The common set of HTML5 Form features that work in all modern HTML5 browsers *Note that IE9 offers no HTML5 forms support Types Email, Tel, Url, Search, Number Attributes Placeholder, MaxLength, NoValidate, Autofocus Elements Output Visual Studio Live! Las Vegas 2011MGB 2003 © 2003 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
  • #40: Sad truth is that HTML5 forms support across all browsers is evolving slowly. BUT…that doesn&apos;t mean this is all for waste. We can use a couple of solutions to take advantage of new HTML5 forms syntax. Visual Studio Live! Las Vegas 2011MGB 2003 © 2003 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
  • #41: HTML5 Forms polyfill: https://github.com/ryanseddon/H5F OR Polyfill approach also gives you more control over rendering in browsers. Makes it useful in modern browsers, too.
  • #43: Baby Steps - HTML5 Forms support is not perfect today, but it is headed in the right direction Visual Studio Live! Las Vegas 2011MGB 2003 © 2003 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
  • #44: Visual Studio Live! Las Vegas 2011MGB 2003 © 2003 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.