05 html5 forms

9
1 HTML5 and CSS3 The Future of the Web Programming HTML5 Forms Sergio Luján Mora

Upload: iratxesartaguda

Post on 20-Nov-2015

212 views

Category:

Documents


0 download

DESCRIPTION

lenguaje de marcas

TRANSCRIPT

  • 1

    HTML5 and CSS3 The Future of the Web Programming

    HTML5 Forms

    Sergio Lujn Mora

  • 2

    HTML5 & CSS3

    Content

    New input types

    New attributes

    HTML5 & CSS3

    NEW INPUT TYPES

  • 3

    HTML5 & CSS3

    multiple: it indicates that the value of the field can be a list of comma-separated, valid email addresses

    HTML5 & CSS3

  • 4

    HTML5 & CSS3

    HTML5 & CSS3

  • 5

    HTML5 & CSS3

    NEW ATTRIBUTES

    HTML5 & CSS3

    autofocus:

    It provides a declarative way to focus a form control when a page is loaded

    Previously, a developer had to write JavaScript that triggered the controls focus() method onload

    There should be only one such input field on a page

  • 6

    HTML5 & CSS3

    placeholder:

    It places text in an input field as a hint for the user, removing the text when the user focuses on the field, and restoring the text when focus leaves the field

    HTML5 & CSS3

    required:

    Browsers will not allow the user to submit the form if required fields are empty and report an error

  • 7

    HTML5 & CSS3

    pattern:

    It allows you to specify a custom regular expression that the input must match

    HTML5 & CSS3

  • 8

    HTML5 & CSS3

    min and max:

    It constrain the range of values that can be entered in an input; you cant submit the form with a number smaller than min or larger than max

    HTML5 & CSS3

    step:

    It controls the level of granularity of input

    Example: you want the user to enter a percentage between 0 and 100, but only to the nearest 5:

  • 9

    HTML5 & CSS3

    Name

    Email

    URL

    Comment

    HTML5 & CSS3

    Name:

    Email:

    Website:

    Number:

    Range: