SlideShare uma empresa Scribd logo
1 de 30
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

Mais conteúdo relacionado

Mais procurados

Progressive Enhancement
Progressive EnhancementProgressive Enhancement
Progressive Enhancement
Bruce Morrison
 
[jqconatx] Adaptive Images for Responsive Web Design
[jqconatx] Adaptive Images for Responsive Web Design[jqconatx] Adaptive Images for Responsive Web Design
[jqconatx] Adaptive Images for Responsive Web Design
Christopher Schmitt
 

Mais procurados (20)

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

Semelhante a Html5 inputs

Bd conf sencha touch workshop
Bd conf sencha touch workshopBd conf sencha touch workshop
Bd conf sencha touch workshop
James Pearce
 
Familiar Tools, New Possibilities: Leveraging the Power of the Adobe Web Pub...
Familiar Tools, New Possibilities:  Leveraging the Power of the Adobe Web Pub...Familiar Tools, New Possibilities:  Leveraging the Power of the Adobe Web Pub...
Familiar Tools, New Possibilities: Leveraging the Power of the Adobe Web Pub...
John Hartley
 
Doing Modern Web, aka JavaScript and HTML5 in the Enterprise NYC Code Camp
Doing Modern Web, aka JavaScript and HTML5 in the Enterprise NYC Code CampDoing Modern Web, aka JavaScript and HTML5 in the Enterprise NYC Code Camp
Doing Modern Web, aka JavaScript and HTML5 in the Enterprise NYC Code Camp
Chris Love
 

Semelhante a Html5 inputs (20)

php
phpphp
php
 
Bd conf sencha touch workshop
Bd conf sencha touch workshopBd conf sencha touch workshop
Bd conf sencha touch workshop
 
Rapid development & integration of real time communication in websites
Rapid development & integration of real time communication in websitesRapid development & integration of real time communication in websites
Rapid development & integration of real time communication in websites
 
Familiar Tools, New Possibilities: Leveraging the Power of the Adobe Web Pub...
Familiar Tools, New Possibilities:  Leveraging the Power of the Adobe Web Pub...Familiar Tools, New Possibilities:  Leveraging the Power of the Adobe Web Pub...
Familiar Tools, New Possibilities: Leveraging the Power of the Adobe Web Pub...
 
Doing Modern Web, aka JavaScript and HTML5 in the Enterprise NYC Code Camp
Doing Modern Web, aka JavaScript and HTML5 in the Enterprise NYC Code CampDoing Modern Web, aka JavaScript and HTML5 in the Enterprise NYC Code Camp
Doing Modern Web, aka JavaScript and HTML5 in the Enterprise NYC Code Camp
 
Serverless by Examples and Case Studies
Serverless by Examples and Case StudiesServerless by Examples and Case Studies
Serverless by Examples and Case Studies
 
Serverless by examples and case studies
Serverless by examples and case studiesServerless by examples and case studies
Serverless by examples and case studies
 
Web Attacks - Top threats - 2010
Web Attacks - Top threats - 2010Web Attacks - Top threats - 2010
Web Attacks - Top threats - 2010
 
Core Web Standards and Competencies - WritersUA East 2015, Scott DeLoach, Cli...
Core Web Standards and Competencies - WritersUA East 2015, Scott DeLoach, Cli...Core Web Standards and Competencies - WritersUA East 2015, Scott DeLoach, Cli...
Core Web Standards and Competencies - WritersUA East 2015, Scott DeLoach, Cli...
 
W3 conf hill-html5-security-realities
W3 conf hill-html5-security-realitiesW3 conf hill-html5-security-realities
W3 conf hill-html5-security-realities
 
HTML5 WebSocket: The New Network Stack for the Web
HTML5 WebSocket: The New Network Stack for the WebHTML5 WebSocket: The New Network Stack for the Web
HTML5 WebSocket: The New Network Stack for the Web
 
Top Ten Tips For Tenacious Defense In Asp.Net
Top Ten Tips For Tenacious Defense In Asp.NetTop Ten Tips For Tenacious Defense In Asp.Net
Top Ten Tips For Tenacious Defense In Asp.Net
 
Automated Testing Of Web Applications Using XML
Automated  Testing Of  Web  Applications Using  XMLAutomated  Testing Of  Web  Applications Using  XML
Automated Testing Of Web Applications Using XML
 
presentation slides
presentation slidespresentation slides
presentation slides
 
Building appsinsilverlight4 part_1
Building appsinsilverlight4 part_1Building appsinsilverlight4 part_1
Building appsinsilverlight4 part_1
 
What's Our Software Doing With All That User Input
What's Our Software Doing With All That User InputWhat's Our Software Doing With All That User Input
What's Our Software Doing With All That User Input
 
DODN2009 - Jump Start Silverlight
DODN2009 - Jump Start SilverlightDODN2009 - Jump Start Silverlight
DODN2009 - Jump Start Silverlight
 
Top Ten Web Hacking Techniques – 2008
Top Ten Web Hacking Techniques – 2008Top Ten Web Hacking Techniques – 2008
Top Ten Web Hacking Techniques – 2008
 
Web Services Security
Web Services SecurityWeb Services Security
Web Services Security
 
Blog Enhancing through Extensions
Blog Enhancing through ExtensionsBlog Enhancing through Extensions
Blog Enhancing through Extensions
 

Mais de Chris Love

Mais de Chris Love (20)

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

Último

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
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
Enterprise Knowledge
 

Último (20)

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
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
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
 
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
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
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
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
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 future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 

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