Introduction to new HTML5 Form
Input Types, Attributes and Validation
Chris Love
@ChrisLove
ProfessionalASPNET.com
Who Am I?
ASP.NET MVP
ASP Insider
Internet Explorer User Agent
Author
Speaker
Tweaker, Lover of Mobile Web, JavaScript, CSS & HTML5
Podcast Interviews
The Tablet Show
Chris Love Talks Surface Pro, Mobile Development and More
http://thetabletshow.com/?ShowNum=80
Chris Love Does Enterprise Mobility
http://thetabletshow.com/?ShowNum=22
Deep Fried Bytes
Mobile Web Is Not What The Other Guys Say It Is
http://deepfriedbytes.com/podcast/episode-74-mobile-web-is-not-what-the-other-guys-say-it-is/
Technology & Friends
Talking About Touch
http://technologyandfriends.com/ <- Coming out Monday
JavaScript Libraries
DeepTissueJS – A Touch Gesture Abstraction Library
http://deeptissuejs.com
PanoramaJS – JavaScript Library to Implement The Windows Phone Panorama Control in HTML5
https://github.com/docluv/panoramajs
ToolbarJS – JavaScript Library to Implement a Mobile AppBar, like Windows Phone
http://toolbarjs.com
Coming Soon!
SPA – Single Page Application Router, View Manager
Backpack – Markup Manager leveraging LocalStorage
FannyPack – Markup Manager leveraging on page markup
??????
Resources
Slide Deck – http://www.slideshare.net/docluv <- Only URL U
Need!
Source Code – https://github.com/docluv/html5inputs
Live Site - http://html5inputs.azurewebsites.net/
HTML5 Brings New Input Types!
Text
File
Password
Radio
Checkbox
Hidden
Submit
Image
Reset
Button
HTML5 Brings New Input Types!
URL
EMAIL
NUMBER
SEARCH
RANGE
DATETIME
TEL
COLOR
MONTH
WEEK
DATE
TIME
HTML5 Brings New Elements!
DATALIST
PROGRESS
HTML5 Brings New Input Attributes!
AUTOFOCUS
REQUIRED
PLACEHOLDER
PATTERN
AUTOCORRECT
AUTOCOMPLETE
MIN, MAX, STEP
FORMACTION
FORMENCTYPE
FORMMETHOD
FORMVALIDATE
FORMTARGET
READONLY
Sometimes You Just Do Not Want AutoCorrect
Why Is This All Important?
Native Functionality Always A Good Thing
Guided Input Good User Experience
Touch – Help Users Type Less
On Screen Keyboards
New Input Types Drive On Screen Keyboards
How FedEx.com Could Increase Customer
Satisfaction and Profits with 10 Minutes of HTML5
http://bit.ly/16pgnv3
E-Mail Keyboard
URL Keyboard
Number Keyboard
Pattern
Allows You To Define the Data Format Validation
Good For Overriding Native Validation & Behavior
Use Regular Expressions
http://html5pattern.com/
Placeholder
Allows You to Place a Message In The Input
Good For Guidance
Can Help Save Screen Real Estate on Phones ;)
Pattern=“Great Idea…”
Validation Bubbles!
Demo Time!
CSS Hooks
Pseudo Classes That Allow You To Overwrite Default Styles
:valid
:invalid
In WebKit Can Override Message Bubbles!
Demo Time!
Constraint Validation
Validation API
willValidate – Can Node Be Validated
validity – returns a ValidityState object
ValidatityState
valid – Does the Value meet criteria
customError – true if custom message set through setCustomValidity()
valueMissing – no value
typeMismatch – not valid based on input type
patternMismatch – does not match the supplied pattern
rangeOverflow & rangeUnderflow – Over or under the max and min attribute values
stepMismatch – invalid per step attribute
tooLong – exceeds maxLength value
checkValidity
Returns true if form node meets validity criteria
<form id="form-1">
<input id="input-1" type="text" required />
</form>
<script>
document.getElementById('form-1').checkValidity(); //false
document.getElementById('input-1').checkValidity(); //false
</script>
invalid Event
Fired Every Time An Input Field Fails Validation
document.getElementById('input-1').addEventListener('invalid', function() {
//Do Something Here...
}, false);
validationMessage
Contains the Message Displayed When Validity Check Fails
Pass Custom Message to setCustomValidity() method
Demo Time!
Dealing With Older Browsers
UPGRADE!!!!!!!
Dealing With Older Browsers
Use Polyfils
https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-Browser-Polyfills
jQuery Validation Plugin
http://bassistance.de/jquery-plugins/jquery-plugin-validation/ <- Should Kick In When
Needed

More Related Content

PPTX
Doing Modern Web, aka JavaScript and HTML5 in the Enterprise
PPTX
5 single page application principles developers need to know
PPTX
Make mobile web apps rock
PPTX
Web Front End Performance
PPTX
That's crazy! how to build single page web apps
PPTX
How To Be an HTML5 Mobile Cloud Champion
PPTX
WebMatrix jQuery Mobile Web
PPTX
From desktop to mobile web
Doing Modern Web, aka JavaScript and HTML5 in the Enterprise
5 single page application principles developers need to know
Make mobile web apps rock
Web Front End Performance
That's crazy! how to build single page web apps
How To Be an HTML5 Mobile Cloud Champion
WebMatrix jQuery Mobile Web
From desktop to mobile web

What's hot (20)

PPTX
10 things to make you a Great Mobile Web Developer
PDF
Single Page Application Best practices
PPTX
PDF
Websocket in iOS application to create real-time applications
PDF
CSS vs. JavaScript - Trust vs. Control
PDF
HTML5@电子商务.com
PPT
Best And Worst Practices Building Ria with Adobe and Microsoft
PPT
Joomla wireframing Template - Joomladay Netherlands 2014 #jd14nl
PDF
Intro to Web Development from Bloc.io
PDF
Leveling up your JavaScipt - DrupalJam 2017
PDF
Progressive Web Apps – the return of the web?
PDF
VT2019 - DA355A - Responsiv webbutveckling
PPTX
5 Skills Needed to be a Successful WebVR Developer
PPT
Creating Yahoo Mobile Widgets
PPTX
Sucuri Webinar: Beginner's Guide to CDNs
PPTX
CC 2015 Single Page Applications for the ASPNET Developer
PPT
Progressive Enhancement
PPTX
Building a resposive slider plugin for WordPress theme
PDF
[jqconatx] Adaptive Images for Responsive Web Design
10 things to make you a Great Mobile Web Developer
Single Page Application Best practices
Websocket in iOS application to create real-time applications
CSS vs. JavaScript - Trust vs. Control
HTML5@电子商务.com
Best And Worst Practices Building Ria with Adobe and Microsoft
Joomla wireframing Template - Joomladay Netherlands 2014 #jd14nl
Intro to Web Development from Bloc.io
Leveling up your JavaScipt - DrupalJam 2017
Progressive Web Apps – the return of the web?
VT2019 - DA355A - Responsiv webbutveckling
5 Skills Needed to be a Successful WebVR Developer
Creating Yahoo Mobile Widgets
Sucuri Webinar: Beginner's Guide to CDNs
CC 2015 Single Page Applications for the ASPNET Developer
Progressive Enhancement
Building a resposive slider plugin for WordPress theme
[jqconatx] Adaptive Images for Responsive Web Design

Similar to Html5 inputs (20)

KEY
HTML5 Form Validation
PDF
HTML5 Forms - KISS time - Fronteers
PPT
HTML5 Mullet: Forms & Input Validation
PPTX
HTML5 Forms OF DOOM
PPT
PDF
Html5 Forms in Squiz Matrix - Dave Letorey
PDF
A Sensational Exposé With Bewildering Demonstrations
PDF
HTML5 workshop, forms
PPTX
Html tables, forms and audio video
PPTX
html 5 new form attribute
PPTX
HTML 5: Attributes
KEY
HTML5: what's new?
PDF
Moving to the client - HTML5 is here
PPTX
form_validation_with_html5
PPTX
Forms with html5
PPTX
Forms with html5 (1)
PDF
Web Forms People Don't Hate
PPTX
html forms 2.pptx
PDF
html5_course_material_introduction_to_html.pdf
PDF
HTML5 Form Validation
HTML5 Forms - KISS time - Fronteers
HTML5 Mullet: Forms & Input Validation
HTML5 Forms OF DOOM
Html5 Forms in Squiz Matrix - Dave Letorey
A Sensational Exposé With Bewildering Demonstrations
HTML5 workshop, forms
Html tables, forms and audio video
html 5 new form attribute
HTML 5: Attributes
HTML5: what's new?
Moving to the client - HTML5 is here
form_validation_with_html5
Forms with html5
Forms with html5 (1)
Web Forms People Don't Hate
html forms 2.pptx
html5_course_material_introduction_to_html.pdf

More from Chris Love (20)

PPTX
Quick Fetch API Introduction
PPTX
Introduction to Progressive Web Applications
PPTX
Introduction to Progressive Web Applications
PPTX
Lazy load Website Assets
PPTX
Progressive Web Apps for Education
PPTX
The server is dead going serverless to create a highly scalable application y...
PPTX
A Day Building Fast, Responsive, Extensible Single Page Applications
PPTX
Real World Lessons in Progressive Web Application & Service Worker Caching
PPTX
Disrupting the application eco system with progressive web applications
PPTX
Service workers your applications never felt so good
PPTX
Develop a vanilla.js spa you and your customers will love
PPTX
JavaScript front end performance optimizations
PPTX
Advanced front end debugging with ms edge and ms tools
PPTX
Html5 Fit: Get Rid of Love Handles
PPTX
Using Responsive Web Design To Make Your Web Work Everywhere - Updated
PPTX
Implementing a Responsive Image Strategy
PPTX
Using Responsive Web Design To Make Your Web Work Everywhere
PPTX
10 things you can do to speed up your web app today 2016
PPT
Css best practices style guide and tips
PPTX
Using Responsive Web Design To Make Your Web Work Everywhere
Quick Fetch API Introduction
Introduction to Progressive Web Applications
Introduction to Progressive Web Applications
Lazy load Website Assets
Progressive Web Apps for Education
The server is dead going serverless to create a highly scalable application y...
A Day Building Fast, Responsive, Extensible Single Page Applications
Real World Lessons in Progressive Web Application & Service Worker Caching
Disrupting the application eco system with progressive web applications
Service workers your applications never felt so good
Develop a vanilla.js spa you and your customers will love
JavaScript front end performance optimizations
Advanced front end debugging with ms edge and ms tools
Html5 Fit: Get Rid of Love Handles
Using Responsive Web Design To Make Your Web Work Everywhere - Updated
Implementing a Responsive Image Strategy
Using Responsive Web Design To Make Your Web Work Everywhere
10 things you can do to speed up your web app today 2016
Css best practices style guide and tips
Using Responsive Web Design To Make Your Web Work Everywhere

Recently uploaded (20)

PDF
FASHION-DRIVEN TEXTILES AS A CRYSTAL OF A NEW STREAM FOR STAKEHOLDER CAPITALI...
PDF
Domain-specific knowledge and context in large language models: challenges, c...
PDF
CEH Module 2 Footprinting CEH V13, concepts
PDF
Child-friendly e-learning for artificial intelligence education in Indonesia:...
PPTX
maintenance powerrpoint for adaprive and preventive
PDF
The AI Revolution in Customer Service - 2025
PPTX
Presentation - Principles of Instructional Design.pptx
PDF
State of AI in Business 2025 - MIT NANDA
PDF
Intravenous drug administration application for pediatric patients via augmen...
PDF
TicketRoot: Event Tech Solutions Deck 2025
PDF
substrate PowerPoint Presentation basic one
PDF
GDG Cloud Southlake #45: Patrick Debois: The Impact of GenAI on Development a...
PDF
Technical Debt in the AI Coding Era - By Antonio Bianco
PPTX
Blending method and technology for hydrogen.pptx
PDF
Chapter 1: computer maintenance and troubleshooting
PPTX
CRM(Customer Relationship Managmnet) Presentation
PPTX
How to use fields_get method in Odoo 18
PDF
Decision Optimization - From Theory to Practice
PPTX
Report in SIP_Distance_Learning_Technology_Impact.pptx
PDF
Uncertainty-aware contextual multi-armed bandits for recommendations in e-com...
FASHION-DRIVEN TEXTILES AS A CRYSTAL OF A NEW STREAM FOR STAKEHOLDER CAPITALI...
Domain-specific knowledge and context in large language models: challenges, c...
CEH Module 2 Footprinting CEH V13, concepts
Child-friendly e-learning for artificial intelligence education in Indonesia:...
maintenance powerrpoint for adaprive and preventive
The AI Revolution in Customer Service - 2025
Presentation - Principles of Instructional Design.pptx
State of AI in Business 2025 - MIT NANDA
Intravenous drug administration application for pediatric patients via augmen...
TicketRoot: Event Tech Solutions Deck 2025
substrate PowerPoint Presentation basic one
GDG Cloud Southlake #45: Patrick Debois: The Impact of GenAI on Development a...
Technical Debt in the AI Coding Era - By Antonio Bianco
Blending method and technology for hydrogen.pptx
Chapter 1: computer maintenance and troubleshooting
CRM(Customer Relationship Managmnet) Presentation
How to use fields_get method in Odoo 18
Decision Optimization - From Theory to Practice
Report in SIP_Distance_Learning_Technology_Impact.pptx
Uncertainty-aware contextual multi-armed bandits for recommendations in e-com...

Html5 inputs

  • 1. Introduction to new HTML5 Form Input Types, Attributes and Validation Chris Love @ChrisLove ProfessionalASPNET.com
  • 2. Who Am I? ASP.NET MVP ASP Insider Internet Explorer User Agent Author Speaker Tweaker, Lover of Mobile Web, JavaScript, CSS & HTML5
  • 3. Podcast Interviews The Tablet Show Chris Love Talks Surface Pro, Mobile Development and More http://thetabletshow.com/?ShowNum=80 Chris Love Does Enterprise Mobility http://thetabletshow.com/?ShowNum=22 Deep Fried Bytes Mobile Web Is Not What The Other Guys Say It Is http://deepfriedbytes.com/podcast/episode-74-mobile-web-is-not-what-the-other-guys-say-it-is/ Technology & Friends Talking About Touch http://technologyandfriends.com/ <- Coming out Monday
  • 4. JavaScript Libraries DeepTissueJS – A Touch Gesture Abstraction Library http://deeptissuejs.com PanoramaJS – JavaScript Library to Implement The Windows Phone Panorama Control in HTML5 https://github.com/docluv/panoramajs ToolbarJS – JavaScript Library to Implement a Mobile AppBar, like Windows Phone http://toolbarjs.com Coming Soon! SPA – Single Page Application Router, View Manager Backpack – Markup Manager leveraging LocalStorage FannyPack – Markup Manager leveraging on page markup ??????
  • 5. Resources Slide Deck – http://www.slideshare.net/docluv <- Only URL U Need! Source Code – https://github.com/docluv/html5inputs Live Site - http://html5inputs.azurewebsites.net/
  • 6. HTML5 Brings New Input Types! Text File Password Radio Checkbox Hidden Submit Image Reset Button
  • 7. HTML5 Brings New Input Types! URL EMAIL NUMBER SEARCH RANGE DATETIME TEL COLOR MONTH WEEK DATE TIME
  • 8. HTML5 Brings New Elements! DATALIST PROGRESS
  • 9. HTML5 Brings New Input Attributes! AUTOFOCUS REQUIRED PLACEHOLDER PATTERN AUTOCORRECT AUTOCOMPLETE MIN, MAX, STEP FORMACTION FORMENCTYPE FORMMETHOD FORMVALIDATE FORMTARGET READONLY
  • 10. Sometimes You Just Do Not Want AutoCorrect
  • 11. Why Is This All Important? Native Functionality Always A Good Thing Guided Input Good User Experience Touch – Help Users Type Less
  • 12. On Screen Keyboards New Input Types Drive On Screen Keyboards
  • 13. How FedEx.com Could Increase Customer Satisfaction and Profits with 10 Minutes of HTML5 http://bit.ly/16pgnv3
  • 17. Pattern Allows You To Define the Data Format Validation Good For Overriding Native Validation & Behavior Use Regular Expressions http://html5pattern.com/
  • 18. Placeholder Allows You to Place a Message In The Input Good For Guidance Can Help Save Screen Real Estate on Phones ;) Pattern=“Great Idea…”
  • 21. CSS Hooks Pseudo Classes That Allow You To Overwrite Default Styles :valid :invalid In WebKit Can Override Message Bubbles!
  • 23. Constraint Validation Validation API willValidate – Can Node Be Validated validity – returns a ValidityState object
  • 24. ValidatityState valid – Does the Value meet criteria customError – true if custom message set through setCustomValidity() valueMissing – no value typeMismatch – not valid based on input type patternMismatch – does not match the supplied pattern rangeOverflow & rangeUnderflow – Over or under the max and min attribute values stepMismatch – invalid per step attribute tooLong – exceeds maxLength value
  • 25. checkValidity Returns true if form node meets validity criteria <form id="form-1"> <input id="input-1" type="text" required /> </form> <script> document.getElementById('form-1').checkValidity(); //false document.getElementById('input-1').checkValidity(); //false </script>
  • 26. invalid Event Fired Every Time An Input Field Fails Validation document.getElementById('input-1').addEventListener('invalid', function() { //Do Something Here... }, false);
  • 27. validationMessage Contains the Message Displayed When Validity Check Fails Pass Custom Message to setCustomValidity() method
  • 29. Dealing With Older Browsers UPGRADE!!!!!!!
  • 30. Dealing With Older Browsers Use Polyfils https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-Browser-Polyfills jQuery Validation Plugin http://bassistance.de/jquery-plugins/jquery-plugin-validation/ <- Should Kick In When Needed