I have a field inside of a form like this:
<input type="text" minlength="20" name="description" id="description" />
When typed into, the minlength
validation works great. But if the input's value is set programmatically the validation won't trigger.
var field = document.querySelector("#description");
// type a couple of character into the field
field.validity.tooShort;
// true
field.value = '';
field.validity.tooShort;
// false
Is there a workaround for this? Or a planned fix? Am I using it wrong?