Bug Tracker

Ticket #4135 (closed bug: invalid)

Opened 6 years ago

Last modified 5 years ago

[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:
Blocking: Blocked by:

Description (last modified by dmethvin) (diff)

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

comment:1 Changed 6 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 5 years ago by dmethvin

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

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.