How to disable twitter bootstrap email validation popover?
javascript, jquery, ruby-on-rails-4, twitter-bootstrap
Solution
Text type is bad UX for email
<input type="text" />
This text type is not bad. But in the mobile web page, this `<input>` tag will display keyboard for just normal text not email. What did it mean? Mobile phone's keyboard did not show `@`, so users should swipe keyboard to type `@`. And they can not use autocomplete. This is bad ux.
Solution
Use novalidate="novalidate" attribute in your `<form>` tag. This attribute skip validation when submitted. Here's examples.
<form novalidate="novalidate" class="simple_form new_user">
...
</form>
If you use rails ERB simple-form, then you can use novalidate like this.
<%= simple_form_for(resource, html: { novalidate: true }) do |f| %>
...
<% end %>
References
- https://developers.google.com/web/fundamentals/design-and-ux/input/forms#html5_input_types
Problem
I have a form field of type email for logging in. We also allow users to log in with their nicknames and phone numbers. The problem is that Twitter bootstrap automatically blocks the form submit if the format in the email field is not email (doesn't contain say '@'). Is there any way to disable this twitter .js binding on clicking my "Sign in" button? Been googling around for some 2 hours now and couldn't find any solutions so I would greatly appreciate any answers!