Skip to content

Instantly share code, notes, and snippets.

@chuckreynolds
Created March 26, 2014 23:21
Show Gist options
  • Save chuckreynolds/9796018 to your computer and use it in GitHub Desktop.
Save chuckreynolds/9796018 to your computer and use it in GitHub Desktop.
Make filling in forms less sucky on mobile devices by using the correct input types.
<!-- For most inputs, you should remove autocorrect and autocapitalize -->
<input type="(your input type)" autocapitalize="off" autocorrect="off">
<!-- Email -->
<input type="email">
<!-- Phone number -->
<input type="tel">
<!-- Some numeric input, like credit card number or ZIP code -->
<input type="text" pattern="d*" novalidate>
<!-- If you use type="submit" instead of type="button", you get the "Go" button on the keyboard-->
<input type="submit">
<!-- Displays the number and special characters keyboard, should only be used in specific cases-->
<input type="number">
<!-- Datepicker -->
<input type="date">
<!-- Datepicker with only months and years -->
<input type="month">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment