16

I understand that text_field creates an input field of type text, while email_field creates an input field of type email.

But, what is the difference between these two input types ?

Say I have a client model while a client has an email. Should I use email_field here ?

Misha Moroshko
  • 166,356
  • 226
  • 505
  • 746
  • 2
    Input type=email is an HTML5 property which validates the input is an email address. http://www.w3.org/TR/html-markup/input.email.html – Gazler Feb 06 '11 at 12:32
  • Little update, email validation now works on most newer browsers. Use email_field to get free browser based validation without script. – superluminary Oct 09 '12 at 11:01

1 Answers1

22

The email field is the new html 5 input which right now behaves the same on most of the machines with the exception of a few mobile devices such as the iphone where it switches to a different keyboard.

You can find more about it by googling html5 email field.

It's just a touch of finesse which some users will appreciate.

vise
  • 12,713
  • 11
  • 52
  • 64