ALF-12630: Validation for numbers with decimal commas.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@45608 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
David Webster
2013-01-18 15:10:44 +00:00
parent c7023643b0
commit 0da673b9cf

View File

@@ -59,9 +59,13 @@ function validateNumberRange(control, min, max, message, showMessage)
*/
function validateIsNumber(control, message, showMessage)
{
var result = true;
var result = true,
testValue = control.value;
if (isNaN(control.value))
// Be tolerant of numbers that contain decimal commas and/or use a dot/apostrophe/space as a thousand separator & ignore.
testValue = testValue.toString().replace(/[ '.,]/g, "");
if (isNaN(testValue))
{
informUser(control, message, showMessage);
result = false;