Skip to content

Required fields error message takes precedence of number type validation #1514

Closed
@roryhardy

Description

@roryhardy

Related to #1318, it appears the issue of the required field error message taking precedence over the number type validation has gotten more prominent as it is now visible in many environments.

Minimum test case (jQuery 1.11.0): http://jsfiddle.net/L9ycncrg/
Minimum test case (jQuery 2.1.3): http://jsfiddle.net/uqdqbofy/

Environments effected:
jQuery 1.11.0
jQuery Validation 1.14.0

Windows 7: Internet Explorer 10
OSX: Chrome 43.0.2357.132, Firefox, Safari 8.0.7 (10600.7.12)
iOS8: Chrome, Safari

In most browsers I've found that a required number field will continue to display "This field is required." instead of "Please enter a valid number." if alpha characters are inserted instead of numeric characters. If I add numbers that exceed min/max rules then the required field error is replaced by the min/max error.

I found it to work correctly when running Internet Explorer 9 on Windows 7.

I did not see any behavioral differences between the versions of jQuery.

In the minimum test cases follow these steps to reproduce:

  1. Click submit to trigger validation
  2. Type "aaa" in the field, notice that the message does not ask you to enter a number, but rather complains that the field is required.

capture

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