1

In the web app I'm working on usernames are usually email addresses - but not always. I'd therefore like to aid most users by displaying the "email address" keyboard to mobile visitors without actually validating the field as an email address.

Tom Carver
  • 962
  • 7
  • 17

2 Answers2

0

MDN's guide suggests that

<input type="text" inputmode="email" />

will provide the combination I need - but that this isn't currently supported by any browsers (Feb 2015). Does anyone know of better solutions that don't involve user-agent sniffing?

Tom Carver
  • 962
  • 7
  • 17
0

You can use the novalidate attribute to skip field validation retaining the type email.

Davide
  • 123
  • 3
  • 8
  • Thanks for your suggestion - I looked into novalidate but it seems to act at the form level rather than the input level? If so then this would mean other changes in our use case, e.g. we use the "required" attribute on the username and password fields and use HTML5 form validation to prevent submission without either value. – Tom Carver Feb 17 '15 at 10:01
  • It seems that's not an official attribute, supported by some browsers: http://stackoverflow.com/questions/9216115/override-html5-validation – Davide Feb 17 '15 at 10:08