8000 Issue with v1.18.0, IE and Required · Issue #2217 · jquery-validation/jquery-validation · GitHub
[go: up one dir, main page]

Skip to content
Issue with v1.18.0, IE and Required #2217
Closed
@phenry2

Description

@phenry2

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0