Consider the following html:
<input bar value="bar">
<input foo readonly value="foo">
The weird thing here is that the first input element is valid and the second one is not just because it is readonly!
$('[bar]').is(':valid') === true
$('[foo]').is(':valid') === false
What is going on here ? And how can I fix this ?