mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
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:
@@ -59,9 +59,13 @@ function validateNumberRange(control, min, max, message, showMessage)
|
|||||||
*/
|
*/
|
||||||
function validateIsNumber(control, 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);
|
informUser(control, message, showMessage);
|
||||||
result = false;
|
result = false;
|
||||||
|
Reference in New Issue
Block a user