Description
Summary of Issue
Since upgrading to v1.18.0, text boxes trigger a required validation error even though there is text in the text box. It does not happen in chrome. Rolling back to v1.17.0 fixed the issue.
Your environment
- version of
jquery-validate
: v1.18.0 - which browser and its version: Internet Explorer v11
Steps to reproduce
Simple MVC Core 2.1 application with a text box created using Html.TextBoxFor. The input element is generated with data-val="true". Html.ValidationFor used to generate the validation error.
Expected behaviour
Would expect no validation error when submit clicked. Normally then when typing in the field, the validation error cleared.
Actual behaviour
Validation error persists and cannot submit form.
Extra debugging revealed that when jquery-validate checked if the element was editable (isContentEditable), it then either did val = $element.text() or val = $element.val(). In the case of my text box, the isContentEditable flag was true, get $element.text() returned "". Hence the required validation failed. $element.val() return the actual contents of the textbox, but this was not used.