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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy