Form Essentials

New things added in HTML5

  • input type=color
  • input type=date
  • input type=range
  • input type=number
  • input type=tel
  • input type=url
  • Form self validation

  • If you want to bypass validation, you can add the 'formnovalidate' attribute to input type
  • "input type = "submit" value = "Submit" formnovalidate "

    Autofocus attribute

  • An optional attribute that can be used in only one input element on a form
  • Automatically gives the focus to the input element
  • Allows the user to begin typing in that element immediately.
  • Required attribute

  • Forces the user to enter a value before submitting the form.
  • You can add required to any of the input types.
  • Autocomplete attribute

  • When we add autocomplete="on" in the form tag the browser automatically fills the form details