The autocapitalize attribute on an input element (used for iOS) breaks validation

As you can see here , Safari and Safari for iPhone support all HTML elements, including obsolete elements and even some proprietary elements that were never part of any W3C specs.

This is really very useful, including autocapitalize in the fields "email" and "site" in forms, since there is nothing so annoying that you need to deselect the SHIFT key when filling out any of these two inputs. Doing this is trivial, since all you have to do is add the autocapitalize=off attribute to the corresponding input, for example:

 <label for="email">E-mail</label> <input type="email" name="email" placeholder=" yourname@domain.com " autocapitalize="off" title="Enter your e-mail address" class="required email" id="email"> 

Both the iPhone and iPad perfectly match keyboards for attributes attached to the input element in forms. Unfortunately, this markup seems to violate the validation, with the W3C responding with "The autocapitalize attribute is not allowed at the entry of an element at this point" when indicated above.

I suppose this is not something to die for, but is there a way to include attributes without breaking validation? Maybe something is wrong with me here.

+6
input ios forms w3c-validation
source share
2 answers

The ughoavgfhw comment fully answers the question: as long as the W3C specifications currently exist, you cannot include the autocapitalize attribute in your forms without breaking validation, so this is a case of weighing the inconvenience that users have to iterate over your forms by clicking on SHIFT button on iOS.

I think this is one of those rare cases (inline styles are another) where it makes sense to come to terms with errors on one page if they are not symptoms of something wrong, but only from W3C a little slow absorption.

+12
source share

Could you just add a class to the input element. And a link to this class with an attribute, text-transform: lowercase?

-one
source share

All Articles