Form "Reset" Causes HTML5 Constraints API Bug

Fixed, not yet flighted Issue #1317049

Details

Created
Jan 9, 2015
Privacy
This issue is public.
Reports
Reported by 0 people

Sign in to watch or report this issue.

Steps to reproduce

URL:http://jsfiddle.net/1do8xp9k/3/.

Repro Steps:

Please Follow these instructions after loading the JSFiddle:

  1. Press the “Submit the Form” button. You will see a couple alerts indicating the
    Textarea is invalid and an error message will appear below the Textarea element.
    This is correct behavior.
  2. Type some text into the Textarea and press the “Submit the Form” button again.
    The alerts indicate there are no errors and the error message below the Textarea
    disappears.
  3. Press the “Reset the Form” button to clear the Textarea and reset the form.
  4. Press the “Submit the Form” button again. Now we see the IE 11 error – IE 11 does
    not detect the fact that the Textarea is empty, as it did in step 1. The alerts indicate
    the Form passed validation! All other browsers correctly indicate the form is invalid
    due to the empty Textarea.

My guess is that the “Reset” button is somehow resetting the Textarea’s “required”-ness, but only in IE. I believe this behavior is incorrect. As you can see, the JavaScript code calls the "checkValidity()" API.

As an alternative (or in addition to) the four steps described above, you can do this to see the error:

  1. Reload the page (Ctrl-R)
  2. Type some text into the TextArea and press the “Reset the Form” button.
  3. Press the “Submit the Form” button. You’ll see the form validates correctly,
    even though the TextArera is empty!

Expected Results:

The “required” attribute on the TextArea element should always cause the checkValidity() call to correctly indicate when the TextArea is empty. It seems that resetting the Form breaks this behavior.

Actual Results:

Dev Channel specific:

No

Attachments

0 attachments

    Comments and activity

    • Microsoft Edge Team

      Changed Assigned To to “Tony S.”

      Changed Assigned To to “Rossen A.”

      Changed Assigned To from “Rossen A.” to “Jonathan H.”

      Changed Status to “Confirmed”

      Changed Status from “Confirmed” to “In code review”

      Changed Status from “In code review” to “In progress”

      Changed Status from “In progress” to “In code review”

      Changed Status from “In code review” to “In progress”

      Changed Assigned To from “Jonathan H.” to “IE F.”

      Changed Status from “In progress” to “Fixed”

      Changed Status from “Fixed” to “Fixed, not yet flighted”

    You need to sign in to your Microsoft account to add a comment.

    Sign in