bootlint icon indicating copy to clipboard operation
bootlint copied to clipboard

E042 when <input> has no type attribute shouldn't call the <input> non-textual

Open Federico-G opened this issue 9 years ago • 4 comments

Error message: .form-control cannot be used on non-textual <input>s, such as those whose type is: file, checkbox, radio, range, button

https://www.w3.org/TR/html5/forms.html#the-input-element The missing value default is the Text state.

https://www.w3.org/TR/html4/interact/forms.html#h-17.4 This attribute specifies the type of control to create. The default value for this attribute is "text".

If I write an input tag without a type, this error should not be trigger, does it?

Federico-G avatar Apr 06 '16 19:04 Federico-G

This is a limitation of Bootstrap's .form-control class as opposed to the HTML standard. See http://getbootstrap.com/css/#callout-input-needs-type

See also https://github.com/twbs/bootlint/wiki/W017 , which is only a warning rather than an error precisely because of the HTML spec sections you cited.

cvrebert avatar Apr 06 '16 19:04 cvrebert

Ok, I agree with that, but bootlint never raised me that warning. The only message that I got was the E042 error.

Digging a bit, in v0.14.2 the W017 warning was not created, that is the version that I get from the javascript browser request.

Thanks

Federico-G avatar Apr 06 '16 19:04 Federico-G

Hmm, it is confusing for the message to call the input non-textual when it is implicitly textual. We should ought to emit a clearer message in that case.

cvrebert avatar Apr 06 '16 19:04 cvrebert

Not sure if I should add as a separate issue or not, but this error also fires when type = "password" which, while masked, is still a text input. The Bootstrap documentation for 3 and 4, shows examples of , which would indicate this is an incorrect error response. https://getbootstrap.com/docs/3.3/css/#forms

uidsouffle avatar Oct 03 '17 03:10 uidsouffle