3

I am currently using the html attribute type email to make a text box open up on a mobile device using the email keyboard. I already have custom email attributes to validate the email address but now it is using the validation that comes with using type email. When I tab off the email field it gives me the message "Please enter a valid email address." with a red box. I want to remove the validation that comes out of the box when using type email. I have already added the novalidate attribute and this does not work.

Does anyone have an alternative to making the email keyboard show up on mobile devices without using the attribute type email?

<form novalidate="novalidate">
    <input type="email" name="email">
</form>

This code will still do out of the box validation when tabbing off the email field.

Juan
  • 147
  • 1
  • 1
  • 10
  • Your question is well-explained, however, you should add some code to it to help illustrate. – Joshua Dannemann Sep 16 '15 at 18:49
  • possible duplicate of [Disable validation of HTML5 form elements](http://stackoverflow.com/questions/3090369/disable-validation-of-html5-form-elements) See the second answer, if first one doesn't work for you. – Shaharyar Sep 16 '15 at 18:55
  • I found that answer earlier and tried that and it did not work for me. – Juan Sep 16 '15 at 19:13
  • Those techniques will work for server side validation. I am talking about client side validation when tabbing off of the field. – Juan Sep 16 '15 at 19:23
  • hmmm for some reason, when I have the form like you have displayed, even without the novalidate, its not validating for me at all... and i have the doctype, its not even happening on fiddle either. at least not on tab off. but i'm fairly sure there's no other way to bring up the email keyboard though – Daemedeor Sep 17 '15 at 03:08
  • I know there is a inputmode attribute that is not recognized by any browsers at this time but will probably be the correct way to bring up specific keyboards in the future. – Juan Sep 17 '15 at 12:35

1 Answers1

0

The inputmode global attribute is now widely used by all the major browsers, since this question was asked.

It will give you the "email" soft keyboard, but will not add any additional validation.

<form novalidate="novalidate">
    <input inputmode="email" name="email">
</form>
Adam Harte
  • 10,369
  • 7
  • 52
  • 85