Bug Tracker

Opened 14 years ago

Closed 13 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 14 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 13 years ago by dmethvin

Description: modified (diff)
Resolution: invalid
Status: newclosed

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.