diff --git a/app/scripts/directives/LateValidateDirective.js b/app/scripts/directives/LateValidateDirective.js index 01461fe0..01640a08 100644 --- a/app/scripts/directives/LateValidateDirective.js +++ b/app/scripts/directives/LateValidateDirective.js @@ -2,11 +2,13 @@ mifosX.directives = _.extend(module, { LateValidateDirective: function () { var numRegex = /^([0-9])*([0-9]+(,)[0-9]+)*$/; + var decimalRegex=/^([0-9])*([0-9]+(,)[0-9]+)*([0-9]+(\.)[0-9]+)*$/; return { restrict: 'A', require: 'ngModel', scope:{ - number:'@number' + number:'@number', + decimalNumber:'@decimalNumber' }, link: function (scope, elm, attr, ctrl) { @@ -14,6 +16,7 @@ elm.bind('blur', function () { scope.$apply(function () { var isMatchRegex = numRegex.test(elm.val()); + var isDecimalMatchRegex=decimalRegex.test(elm.val()); if (elm.val() == "") { ctrl.$setValidity('req', false); } else { @@ -26,6 +29,13 @@ ctrl.$setValidity('nval', false); } } + if(scope.decimalNumber) { + if (isDecimalMatchRegex || elm.val() == '') { + ctrl.$setValidity('nval', true); + } else { + ctrl.$setValidity('nval', false); + } + } }); }); } diff --git a/app/views/products/createfixeddepositproduct.html b/app/views/products/createfixeddepositproduct.html index 8f2022e9..8e02e96a 100755 --- a/app/views/products/createfixeddepositproduct.html +++ b/app/views/products/createfixeddepositproduct.html @@ -12,23 +12,22 @@