BUGFIX Fixed NumericField->jsValidation(), now accepts negative numbers, making it more like the equivalent phpValidation(), which is using is_numeric() (see #4874, thanks Allisone)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@97482 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2010-01-25 07:57:35 +00:00 committed by Sam Minnee
parent 73409d4cac
commit 0d79696883

View File

@ -24,7 +24,7 @@ Behaviour.register({
el = _CURRENT_FORM.elements[fieldName];
if(!el || !el.value) return true;
if(el.value.match(/^\s*([0-9]+(\.[0-9]+)?\s*$)/)) {
if(el.value.match(/^\s*(\-?[0-9]+(\.[0-9]+)?\s*$)/)) {
return true;
} else {
validationError(el, "'" + el.value + "' $error","validation");