I use the latest version of jQuery validation unobtrusive in combination with the latest version of jQuery Validate. Validation itself works like a charm. However, if the field is invalid, the values will be added to the aria-describedby attribute.
Let's say I want to enter my password (for verification, the password must be longer than 6). The initial HTML is as follows:
<input data-val="true" data-val-minlength="The field Passwort must be a string or array type with a minimum length of '6'." data-val-minlength-min="6" data-val-required="The Passwort field is required." id="Password" name="Password" tabindex="2" type="password">
I start entering a password with only 5 characters, and then remove the focus from input by clicking somewhere on the body . Validation is complete and many attributes and values are added, including aria-describedby . Now the aria-describedby attribute has only one Password-error value. If I focus the input field again and delete all the characters and even keep pressing backspace, a new value is added for each key. This leads to the following:
<input data-val="true" data-val-minlength="The field Passwort must be a string or array type with a minimum length of '6'." data-val-minlength-min="6" data-val-required="The Passwort field is required." id="Password" name="Password" tabindex="2" type="password" aria-required="true" aria-invalid="true" class="input-validation-error" aria-describedby="Password-error Password-error Password-error Password-error Password-error Password-error Password-error Password-error Password-error Password-error Password-error Password-error Password-error Password-error Password-error Password-error Password-error Password-error Password-error Password-error Password-error Password-error Password-error Password-error">
This is a pretty overhead for the value for the attribute stating that the values are equal. Is this normal behavior or does anyone know how to fix this?
source share