Bug Tracker

Opened 7 years ago

Closed 6 years ago

#4135 closed bug (invalid)

[validate] number validation method fails if first char is decimal

Reported by: ryan.rch Owned by:
Priority: major Milestone: 1.3.2
Component: plugin Version: 1.3.1
Keywords: validate plugin Cc:
Blocked by: Blocking:

Description (last modified by dmethvin)

succeeds for '0.25' but fails for '.25'

I suggest modifying the regexp as such: /-?(\d*|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(value);

seems to work for me.

This site says to file with author, while author says to file here...

Change History (2)

comment:1 Changed 7 years ago by mozingod

We're having the same issue. A slightly less intrusive fix for the regex would be to just replace the first one or more repeat matcher with the zero or more one:

original: /-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/

modified: /-?(?:\d*|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/

comment:2 Changed 6 years ago by dmethvin

  • Description modified (diff)
  • Resolution set to invalid
  • Status changed from new to closed

This is not a jQuery core bug. Please report plugin bugs to the plugin's author, or ask on the jQuery forums. jQuery UI bugs should be reported on the UI bug tracker, http://dev.jqueryui.com .

Note: See TracTickets for help on using tickets.