Closed tobiasgr closed 9 years ago
Thanks @tobiasgr! I had no idea that hidden
inputs cannot have readonly
attributes. Nice you validated it.
I have created a counterpart data-readonly
data attribute to replace the regular readonly
one. By now both will be allowed but the regular readonly
one will be deprecated in favor of the data version attribute.
So this version:
<input type="hidden" class="rating" data-readonly>
should be used instead of:
<input type="hidden" class="rating" readonly>
Now the demo page was successfully checked as HTML5
For documentation:
According to the W3C Markup Validation Service the readonly
attribute is not allowed for hidden input elements.
Attribute readonly not allowed on element input at this point.
<input type="hidden" class="rating" readonly="readonly" value="3"/>
It is only allowed for:
Attribute readonly is only allowed when the input type is date, datetime, datetime-local, email, month, number, password, search, tel, text, time, url, or week.
Awesome, that was fast! Thanks!
Hi Thank you for an awesome, and very simple rating plugin! I tried validate my html after adding your plugin, but this setting:
is not valid html. input with type "hidden" does not have a readonly property.