Web Forms and Mobile Keyboards

Have you ever been on a mobile website, filling out a form, being asked for your email address, and much to your annoyance the keyboard being shown on your phone doesn’t have a “@” or a “.” on it? So you switch to an alternate keyboard display, but it would be so much nicer if the web developer knew that you were going to need those keys.

There is an easy way to fix this.  Take a look at the image below of web forms on three separate iPhone screenshots.  Notice how in the middle screen the focus is on the Email field and the primary keyboard shows the “@” and the “.”  Notice how when the Telephone field is selected that the keyboard switches to numbers.

mobileforms4

This is a very simple thing to do in the HTML code of your web forms.  For each field, just be sure to set the type attribute accurately.  For example:

<input type="email" placeholder="Enter your email address">

Just by adding type=”email” the mobile device will know which keyboard to present. The same goes for your telephone number.

<input type="tel" placeholder="Enter your phone number">

The full list of these HTML5  input field type attributes is:

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

It’s just one simple thing you can do to improve the user experience of your website or application, especially on a mobile device.  Subconsciously, the end user will be more at ease and think more highly of you.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  • CSS Styling the Audio Element

    There are a few things you can do with CSS to style the HTML audio element in various browsers.

  • How to Get WP RSS Aggregator Feed to Validate

    I’m using the plugin WP RSS Aggregator, and I couldn’t get the custom feed to validate in other places. The validator said that it was missing an <author> field. If an item doesn’t have an author, then the feed doesn’t even supply an empty one. The way to fix it is to go to wp-content/plugins/wp-rss-aggregator/templates/custom-feed/entry.twig ... Read more

  • How to Remove Rank Math Top Banner

    Rank Math has added an ugly top banner to the sites using its plugin. Here's how to hide it.

  • Fix for High CPU Usage on Siteground

    The MailPoet cron job on my website was triggered by Google Bot and caused my CPU seconds on Siteground to go over the quota. Here's how I fixed it.

  • Fast MIDI Song Starter

    Here is a really easy way to build MIDI chord progressions using iRealPro.

  • What is Full Kontakt Required?

    Perhaps you don't know what Kontakt is or how it works. Hopefully we can sort these things out and get you on your way to making some music.

  • How To Style a Range Input Slider

    If you are going to build a custom html audio player, you will need to know how to style a range input slider.

  • How to Build a HTML Audio Player with Vanilla JS (Part 2)

    Here is another tutorial on how to build a custom html audio player with vanilla js.

  • Coding a Custom HTML Audio Player (Part 1)

    Here is a starter tutorial on how to create a custom HTML audio player with HTML and JavaScript.