Input type=number does not return an empty string for non numeric values

Fixed Issue #301144


Jun 9, 2014
This issue is public.
Reported by 0 people

Sign in to watch or report this issue.

Steps to reproduce


Repro Steps:

  1. Go to a page with a number input.
  2. Enter an invalid input (0-0).
  3. Log inputElement.value.

This is a reduced example -
data:text/html,<!doctype html><input type="number" id="foo" value="0-0"/><script>alert(document.getElementById(“foo”).value)</script>

Expected Results:

An empty string is logged.

Actual Results:


0 attachments

    Comments and activity

    • Microsoft Edge Team

      Changed Assigned To to “Tony S.”

      Changed Assigned To from “Tony S.” to “Eugene V.”

      Changed Status to “Confirmed”

      Changed Assigned To from “Eugene V.” to “Navin J.”

      Changed Assigned To from “Navin J.” to “IE F.”

      Changed Status from “Confirmed” to “Won’t fix”

      Changed Status from “Won’t fix” to “Duplicate”

      Changed Status from “Duplicate” to “Fixed”

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

    Sign in