SlideShare une entreprise Scribd logo
1  sur  34
Télécharger pour lire hors ligne
HTML5
Web forms & microdata
      Akiva Levy, SixThirteen
    http://sixthirteendesign.com




                  2011.03.27 Tel Aviv, Israel
Web forms
Input Types
Input type: email
            <input type="email" />
•   Falls back to type="text" for browsers currently lacking
    support

•   iPhone’s mobile Safari will switch to the numeric
    keyboard type
Input type: URL
               <input type="url" />
•   Falls back to type="text" for browsers currently lacking
    support

•   iPhone’s mobile Safari will use the URI keyboard input
    type
Input type: search
           <input type="search" />
•   Falls back to type="text" for browsers currently lacking
    support

•   Vendors style this element to match their browser’s
    native UI

•   Currently only supported by Mac OS X Safari
Input type: search
          <input type="search" />

             Matching native Mac Safari UI


Includes the native one-click clear button within element
Input type: COLOR
             <input type="color" />
•   Falls back to type="text" for browsers currently lacking
    support

•   Utilizes the native OS colour picker widget

•   Returns a six digit hexidecimal colour value (ie.
    27272a)

•   Currently only supported by Opera 11
Input type: COLOR
<input type="color" />
Input type: NUMBER
          <input type="number" />
•   Optional attributes include: min, max, step, and value

•   Falls back to type="text" for browsers currently lacking
    support

•   Styling is dependent upon Vendor implementation

•   Activates iPhone’s on-screen keyboard to numeric type

•   Desktop Opera implements a “spin box”
Input type: NUMBER
            <input type="number" />
•   Offers additional Javascript methods:

    •   input.stepUp(n)

    •   input.stepDown(n)

    •   input.valueAsNumber
Input type: Range
            <input type="range" />
•   Works much the same as the new number input type

•   Vendors are expected to display as a horizontal slider
Input type: Range
            <input type="range" />
•   However, iPhone does not display range as a slider

•   Nor does it select the numeric keyboard type

•   iPhone simply falls back to the text type…
Other new bits
Placeholder
       <input placeholder="Enter e-mail address" />

•   Allows for a DOM-specific way to populate an input
    field with placeholder text, usually instructing the user
    as to the expected action they should perform

•   Aims to remove the need for Javascript hacks to
    manage this
AUTOfocus
               <input autofocus />
•   Allows for a DOM-specific way to automatically focus
    on a particular input field

•   Aims to remove the need for Javascript hacks to
    manage this

•   Solves usability problems by allowing this feature to be
    enabled or disabled as a preference within the browser

•   Power users everywhere rejoice!
validation
•   Aims to replace the need for client-side validation

•   Works for types: url, email, and number

•   Enabled by default in browsers that support it

•   To explicitly disable this feature use: <form novalidate>

•   Some current implementations are incomplete and do
    not offer any visual feedback when validation fails,
    leaving users guessing why the form did not submit
Validation
       Example e-mail validation




Example number with max value validation
Required
                <input required />
•   Ties into validation, as simple as adding required
Example
contact form
Microdata
Microdata

•   Offers a means to add semantic context to your markup

•   Alternative to RDFa, Microformats, etc.

•   Extensible and definable

•   Machine-readable data allows for easily digestible
    meaning to markup, allowing for richer context of
    content
Microdata: Why care?

•   Allowing your markup to be easily digestible by
    machines means your content can be extrapolated in
    meaningful ways

•   Microdata allows you to implement semantics easily

•   Microdata allows machines to understand the context
    of your site easily

•   Microdata = win / win
MICRODATA: How?
•   Create meaningful context using scoped name/value
    pairs

•   Choose (or define) a vocabulary appropriate for your
    content and declare using itemscope and itemtype="" in
    the parent node

•   For each piece of data you wish to annotate, use      o
                                                         __|__

    itemprop=""                                         /_____
                                                   ____[ - - /]____
                                                  / # _____/ /# /
                                                 / # _.---._/ #/ 
                                                / /| | | /| 


    Let’s see an example…
                                               /___/ | | | | | | ___

•                                              | | | | |---| | | | |
                                               |__| _| |___| |_/ |__|
                                               // < ___ /> //
                                               ||/ | | | | ||/
                                                     | | | |
                                                     |---| |---|
                                                     |---| |---|
                                                     | | | |
                                                     |___| |___|
                                                     /  /
MICRODATA: How?


       Loading…

                             o
                            __|__
                           /_____
                      ____[ O O /]____
                     / # _____/ /# /
                    / # _.---._/ #/ 
                   / /| | | /| 
                  /___/ | | | | | | ___
                  | | | | |---| | | | |
                  |__| _| |___| |_/ |__|
                  // < ___ /> //
                  ||/ | | | | ||/
                        | | | |
                        |---| |---|
                        |---| |---|
                        | | | |
                        |___| |___|
                        /  /
Recommended links

Read         http://html5doctor.com



 Test         http://modernizr.com



Review   http://foolip.org/microdatajs/live
</presentation>
<standingOvation />
Thanks!

 Akiva Levy, founder of SixThirteen
   Developer, Designer, Advocate


         HTTP://SIXTHIRTEENDESIGN.CO
 WWW
                       M
         INFO@SIXTHIRTEENDESIGN.CO
E-MAIL
                       M
TWITTER @AKIVALEVY @SIXTHIRTEENCO

Contenu connexe

Similaire à HTML5 Web forms & microdata - Akiva Levi

Quiz game documentary
Quiz game documentaryQuiz game documentary
Quiz game documentaryALI RAZA
 
LAB PHP Consolidated.ppt
LAB PHP Consolidated.pptLAB PHP Consolidated.ppt
LAB PHP Consolidated.pptYasirAhmad80
 
Using BDD to Solve communication problems
Using BDD to Solve communication problemsUsing BDD to Solve communication problems
Using BDD to Solve communication problemsRodrigo Urubatan
 
DDD on example of Symfony (SfCampUA14)
DDD on example of Symfony (SfCampUA14)DDD on example of Symfony (SfCampUA14)
DDD on example of Symfony (SfCampUA14)Oleg Zinchenko
 
Vulnerabilities in TN3270 based Application
Vulnerabilities in TN3270 based ApplicationVulnerabilities in TN3270 based Application
Vulnerabilities in TN3270 based ApplicationSensePost
 
Rails antipattern-public
Rails antipattern-publicRails antipattern-public
Rails antipattern-publicChul Ju Hong
 
Rails antipatterns
Rails antipatternsRails antipatterns
Rails antipatternsChul Ju Hong
 
SEC303 Automating Security in Cloud Workloads with DevSecOps
SEC303 Automating Security in Cloud Workloads with DevSecOpsSEC303 Automating Security in Cloud Workloads with DevSecOps
SEC303 Automating Security in Cloud Workloads with DevSecOpsAmazon Web Services
 
Outfittery hiring at TechStartupJobs Fair Berlin Spring 2015
Outfittery hiring at TechStartupJobs Fair Berlin Spring 2015Outfittery hiring at TechStartupJobs Fair Berlin Spring 2015
Outfittery hiring at TechStartupJobs Fair Berlin Spring 2015TechMeetups
 
Deep Dive Into ejabberd Pubsub Implementation
Deep Dive Into ejabberd Pubsub ImplementationDeep Dive Into ejabberd Pubsub Implementation
Deep Dive Into ejabberd Pubsub ImplementationMickaël Rémond
 
Webinar: From Relational Databases to MongoDB - What You Need to Know
Webinar: From Relational Databases to MongoDB - What You Need to KnowWebinar: From Relational Databases to MongoDB - What You Need to Know
Webinar: From Relational Databases to MongoDB - What You Need to KnowMongoDB
 
How to Get the Best MoBull Experience
How to Get the Best MoBull ExperienceHow to Get the Best MoBull Experience
How to Get the Best MoBull ExperienceJeremyOtt5
 
Progressively Enhancing WordPress Themes
Progressively Enhancing WordPress ThemesProgressively Enhancing WordPress Themes
Progressively Enhancing WordPress ThemesDigitally
 
Final Year Project Presentation
Final Year Project PresentationFinal Year Project Presentation
Final Year Project PresentationSyed Absar
 
Max Voloshin - "Organization of frontend development for products with micros...
Max Voloshin - "Organization of frontend development for products with micros...Max Voloshin - "Organization of frontend development for products with micros...
Max Voloshin - "Organization of frontend development for products with micros...IT Event
 

Similaire à HTML5 Web forms & microdata - Akiva Levi (20)

Quiz game documentary
Quiz game documentaryQuiz game documentary
Quiz game documentary
 
LAB PHP Consolidated.ppt
LAB PHP Consolidated.pptLAB PHP Consolidated.ppt
LAB PHP Consolidated.ppt
 
Using BDD to Solve communication problems
Using BDD to Solve communication problemsUsing BDD to Solve communication problems
Using BDD to Solve communication problems
 
DDD on example of Symfony (SfCampUA14)
DDD on example of Symfony (SfCampUA14)DDD on example of Symfony (SfCampUA14)
DDD on example of Symfony (SfCampUA14)
 
Vulnerabilities in TN3270 based Application
Vulnerabilities in TN3270 based ApplicationVulnerabilities in TN3270 based Application
Vulnerabilities in TN3270 based Application
 
Introduction to JAX-RS
Introduction to JAX-RSIntroduction to JAX-RS
Introduction to JAX-RS
 
Rails antipattern-public
Rails antipattern-publicRails antipattern-public
Rails antipattern-public
 
jQuery mobile UX
jQuery mobile UXjQuery mobile UX
jQuery mobile UX
 
Ess
EssEss
Ess
 
Rails antipatterns
Rails antipatternsRails antipatterns
Rails antipatterns
 
SEC303 Automating Security in Cloud Workloads with DevSecOps
SEC303 Automating Security in Cloud Workloads with DevSecOpsSEC303 Automating Security in Cloud Workloads with DevSecOps
SEC303 Automating Security in Cloud Workloads with DevSecOps
 
Outfittery hiring at TechStartupJobs Fair Berlin Spring 2015
Outfittery hiring at TechStartupJobs Fair Berlin Spring 2015Outfittery hiring at TechStartupJobs Fair Berlin Spring 2015
Outfittery hiring at TechStartupJobs Fair Berlin Spring 2015
 
Code workshop
Code workshopCode workshop
Code workshop
 
Deep Dive Into ejabberd Pubsub Implementation
Deep Dive Into ejabberd Pubsub ImplementationDeep Dive Into ejabberd Pubsub Implementation
Deep Dive Into ejabberd Pubsub Implementation
 
Webinar: From Relational Databases to MongoDB - What You Need to Know
Webinar: From Relational Databases to MongoDB - What You Need to KnowWebinar: From Relational Databases to MongoDB - What You Need to Know
Webinar: From Relational Databases to MongoDB - What You Need to Know
 
How to Get the Best MoBull Experience
How to Get the Best MoBull ExperienceHow to Get the Best MoBull Experience
How to Get the Best MoBull Experience
 
Count to 10 and Say Yes
Count to 10 and Say YesCount to 10 and Say Yes
Count to 10 and Say Yes
 
Progressively Enhancing WordPress Themes
Progressively Enhancing WordPress ThemesProgressively Enhancing WordPress Themes
Progressively Enhancing WordPress Themes
 
Final Year Project Presentation
Final Year Project PresentationFinal Year Project Presentation
Final Year Project Presentation
 
Max Voloshin - "Organization of frontend development for products with micros...
Max Voloshin - "Organization of frontend development for products with micros...Max Voloshin - "Organization of frontend development for products with micros...
Max Voloshin - "Organization of frontend development for products with micros...
 

Plus de Israeli Internet Association technology committee

יחידת לימוד – תכנון ופיתוח אפליקציות ווב למכשירים ניידים
יחידת לימוד – תכנון ופיתוח אפליקציות ווב למכשירים ניידיםיחידת לימוד – תכנון ופיתוח אפליקציות ווב למכשירים ניידים
יחידת לימוד – תכנון ופיתוח אפליקציות ווב למכשירים ניידיםIsraeli Internet Association technology committee
 

Plus de Israeli Internet Association technology committee (20)

נגישות באינטרנט לאנשים עם מוגבלות, הלכה למעשה
נגישות באינטרנט לאנשים עם מוגבלות, הלכה למעשהנגישות באינטרנט לאנשים עם מוגבלות, הלכה למעשה
נגישות באינטרנט לאנשים עם מוגבלות, הלכה למעשה
 
ליאור שיאון - מפת מקלטים
ליאור שיאון - מפת מקלטיםליאור שיאון - מפת מקלטים
ליאור שיאון - מפת מקלטים
 
טל גלילי - אושאידי
טל גלילי - אושאידיטל גלילי - אושאידי
טל גלילי - אושאידי
 
אמרי באומר - האקתון חוסן לאומי
אמרי באומר - האקתון חוסן לאומיאמרי באומר - האקתון חוסן לאומי
אמרי באומר - האקתון חוסן לאומי
 
אורי סגל - מרחב מוגן
אורי סגל - מרחב מוגןאורי סגל - מרחב מוגן
אורי סגל - מרחב מוגן
 
אופיר בן אבי - ממשל זמין
אופיר בן אבי - ממשל זמיןאופיר בן אבי - ממשל זמין
אופיר בן אבי - ממשל זמין
 
יובל טיסונה - המלחמה הבאה
יובל טיסונה - המלחמה הבאהיובל טיסונה - המלחמה הבאה
יובל טיסונה - המלחמה הבאה
 
עמוס גבע - StandWithUs
עמוס גבע - StandWithUsעמוס גבע - StandWithUs
עמוס גבע - StandWithUs
 
בן לנג - Iron Dome Count
בן לנג - Iron Dome Countבן לנג - Iron Dome Count
בן לנג - Iron Dome Count
 
יחידת לימוד – תכנון ופיתוח אפליקציות ווב למכשירים ניידים
יחידת לימוד – תכנון ופיתוח אפליקציות ווב למכשירים ניידיםיחידת לימוד – תכנון ופיתוח אפליקציות ווב למכשירים ניידים
יחידת לימוד – תכנון ופיתוח אפליקציות ווב למכשירים ניידים
 
האם ויקיפדיה מונגשת לאנשים עם מוגבלויות?
האם ויקיפדיה מונגשת לאנשים עם מוגבלויות? האם ויקיפדיה מונגשת לאנשים עם מוגבלויות?
האם ויקיפדיה מונגשת לאנשים עם מוגבלויות?
 
IPv6 - Global Adoption - Ran Liberman
IPv6 - Global Adoption - Ran LibermanIPv6 - Global Adoption - Ran Liberman
IPv6 - Global Adoption - Ran Liberman
 
implementing IPv6 in an ISP network, case study and lessons learned - Amos Ro...
implementing IPv6 in an ISP network, case study and lessons learned - Amos Ro...implementing IPv6 in an ISP network, case study and lessons learned - Amos Ro...
implementing IPv6 in an ISP network, case study and lessons learned - Amos Ro...
 
IPv6 training guide - Yuval Shaul
IPv6 training guide - Yuval ShaulIPv6 training guide - Yuval Shaul
IPv6 training guide - Yuval Shaul
 
פתיחה - יום השקת IPv6 בישראל
פתיחה - יום השקת IPv6 בישראלפתיחה - יום השקת IPv6 בישראל
פתיחה - יום השקת IPv6 בישראל
 
How I learned to stop writing CSS and start writing SASS
How I learned to stop writing CSS and start writing SASSHow I learned to stop writing CSS and start writing SASS
How I learned to stop writing CSS and start writing SASS
 
אבטחת מידע לעובדים בארגון
אבטחת מידע לעובדים בארגוןאבטחת מידע לעובדים בארגון
אבטחת מידע לעובדים בארגון
 
מכללת ספיר - W3C - תהליכים וטכנולוגיות
מכללת ספיר - W3C - תהליכים וטכנולוגיותמכללת ספיר - W3C - תהליכים וטכנולוגיות
מכללת ספיר - W3C - תהליכים וטכנולוגיות
 
Mobile web design Eyal Sela
Mobile web design   Eyal SelaMobile web design   Eyal Sela
Mobile web design Eyal Sela
 
HTML5, ווב נייד ותקנים פתוחים ברשת
HTML5, ווב נייד ותקנים פתוחים ברשת HTML5, ווב נייד ותקנים פתוחים ברשת
HTML5, ווב נייד ותקנים פתוחים ברשת
 

HTML5 Web forms & microdata - Akiva Levi

  • 1. HTML5 Web forms & microdata Akiva Levy, SixThirteen http://sixthirteendesign.com 2011.03.27 Tel Aviv, Israel
  • 4. Input type: email <input type="email" /> • Falls back to type="text" for browsers currently lacking support • iPhone’s mobile Safari will switch to the numeric keyboard type
  • 5. Input type: URL <input type="url" /> • Falls back to type="text" for browsers currently lacking support • iPhone’s mobile Safari will use the URI keyboard input type
  • 6. Input type: search <input type="search" /> • Falls back to type="text" for browsers currently lacking support • Vendors style this element to match their browser’s native UI • Currently only supported by Mac OS X Safari
  • 7. Input type: search <input type="search" /> Matching native Mac Safari UI Includes the native one-click clear button within element
  • 8. Input type: COLOR <input type="color" /> • Falls back to type="text" for browsers currently lacking support • Utilizes the native OS colour picker widget • Returns a six digit hexidecimal colour value (ie. 27272a) • Currently only supported by Opera 11
  • 9. Input type: COLOR <input type="color" />
  • 10. Input type: NUMBER <input type="number" /> • Optional attributes include: min, max, step, and value • Falls back to type="text" for browsers currently lacking support • Styling is dependent upon Vendor implementation • Activates iPhone’s on-screen keyboard to numeric type • Desktop Opera implements a “spin box”
  • 11. Input type: NUMBER <input type="number" /> • Offers additional Javascript methods: • input.stepUp(n) • input.stepDown(n) • input.valueAsNumber
  • 12. Input type: Range <input type="range" /> • Works much the same as the new number input type • Vendors are expected to display as a horizontal slider
  • 13. Input type: Range <input type="range" /> • However, iPhone does not display range as a slider • Nor does it select the numeric keyboard type • iPhone simply falls back to the text type…
  • 14.
  • 16. Placeholder <input placeholder="Enter e-mail address" /> • Allows for a DOM-specific way to populate an input field with placeholder text, usually instructing the user as to the expected action they should perform • Aims to remove the need for Javascript hacks to manage this
  • 17. AUTOfocus <input autofocus /> • Allows for a DOM-specific way to automatically focus on a particular input field • Aims to remove the need for Javascript hacks to manage this • Solves usability problems by allowing this feature to be enabled or disabled as a preference within the browser • Power users everywhere rejoice!
  • 18. validation • Aims to replace the need for client-side validation • Works for types: url, email, and number • Enabled by default in browsers that support it • To explicitly disable this feature use: <form novalidate> • Some current implementations are incomplete and do not offer any visual feedback when validation fails, leaving users guessing why the form did not submit
  • 19. Validation Example e-mail validation Example number with max value validation
  • 20. Required <input required /> • Ties into validation, as simple as adding required
  • 23. Microdata • Offers a means to add semantic context to your markup • Alternative to RDFa, Microformats, etc. • Extensible and definable • Machine-readable data allows for easily digestible meaning to markup, allowing for richer context of content
  • 24. Microdata: Why care? • Allowing your markup to be easily digestible by machines means your content can be extrapolated in meaningful ways • Microdata allows you to implement semantics easily • Microdata allows machines to understand the context of your site easily • Microdata = win / win
  • 25.
  • 26. MICRODATA: How? • Create meaningful context using scoped name/value pairs • Choose (or define) a vocabulary appropriate for your content and declare using itemscope and itemtype="" in the parent node • For each piece of data you wish to annotate, use o __|__ itemprop="" /_____ ____[ - - /]____ / # _____/ /# / / # _.---._/ #/ / /| | | /| Let’s see an example… /___/ | | | | | | ___ • | | | | |---| | | | | |__| _| |___| |_/ |__| // < ___ /> // ||/ | | | | ||/ | | | | |---| |---| |---| |---| | | | | |___| |___| / /
  • 27. MICRODATA: How? Loading… o __|__ /_____ ____[ O O /]____ / # _____/ /# / / # _.---._/ #/ / /| | | /| /___/ | | | | | | ___ | | | | |---| | | | | |__| _| |___| |_/ |__| // < ___ /> // ||/ | | | | ||/ | | | | |---| |---| |---| |---| | | | | |___| |___| / /
  • 28.
  • 29.
  • 30.
  • 31. Recommended links Read http://html5doctor.com Test http://modernizr.com Review http://foolip.org/microdatajs/live
  • 34. Thanks! Akiva Levy, founder of SixThirteen Developer, Designer, Advocate HTTP://SIXTHIRTEENDESIGN.CO WWW M INFO@SIXTHIRTEENDESIGN.CO E-MAIL M TWITTER @AKIVALEVY @SIXTHIRTEENCO