HTML5 Attributes

Thomas Romera edited this page Mar 25, 2016 · 2 revisions

HTML5 brings dozen of new input types (such as number, email, etc.) and attributes (such as required, min, max, step, etc.). SimpleForm would automatically add these attributes where appropriate.

Some of these types would trigger client side validation. If you have problems with client side validation (because of browser inconsistent behavior or issues with javascript code that hide required fields) you can turn off client validation with ‘novalidate’ attribute on form:

<%= simple_form_for(resource, html: {novalidate: true}) do |form| %>

Often and not very descriptive error in webkit browsers that prevents invalid form to be submitted is: An invalid form control with name FIELDNAME is not focusable.

A further explanation of the required attributes behavior on HTML5 compatible browsers can be read in Dive Into HTML5 . If you experience unexpected errors doing integration testing, as the one described in this conversation, make sure you either deactivate html5 validations, or fill in all the required fields.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.