HTML5 forms and input types

March 26th, 2011 | Html5

As a web developer, I dealt with web forms in HTML 4 most of the time. These are the plain text fields that you fill up whenever a site requires for your information. Examples are sign up and login forms. In order to give users the smooth experience as possible, like form validation, you will end up having to use Javascript. But that was in HTML 4. In HTML5, this was changed.

HTML5 form validation doesn’t need Javascript. It has a built-in validation that will make the job easy for you. It is backwards-compatible with legacy browsers that don’t understand HTML5. Meaning, if your browser doesn’t support HTML5, you are going to end up entering data in a plain text field.

HTML5 has new input types that you can use in your forms:

  • email
  • url
  • date
  • time
  • datetime
  • month
  • week
  • number
  • range
  • search
  • tel
  • color

Personally, I think I will use HTML 4 forms and Javascript in my projects because HTML5 is on its early stage so its not the same throughout modern browsers.

Leave a Reply

  • Name (required)
  • Mail (will not be published) (required)
  • Website
  • Message