December 2013

Drupal 7 email fields

Submitted by bas on Tue, 17/12/2013 - 11:20

Sometimes the small tips are the nicest. If you own a smartphone or tablet it can be annoying to enter an email address in a regular textfield. If you fill out a form and select the email field you expect an virtual keyboard layout suited for filling in email addresses, not your default keyboard layout. The simple trick to get this field to behave is to use the HTML5 <input type="email" /> tag. Now the default Drupal 7 Form API only supports regular text inputs.