diff --git a/app/css/custom.css b/app/css/custom.css index 5b94e4f..5de728e 100644 --- a/app/css/custom.css +++ b/app/css/custom.css @@ -690,4 +690,13 @@ font-size: 10px !important; .myLoader img{ position: relative; top: calc(50% - 25px); +} +.customErrorInput{ + background-color: rgb(251, 227, 228); + border: 1px solid #fbc2c4; + color: #8a1f11; +} +.customErrorMessage{ + color: #8a1f11; + font-weight: bold; } \ No newline at end of file diff --git a/app/partials/customers/customers.controller.js b/app/partials/customers/customers.controller.js index e5a66b9..4f18efd 100644 --- a/app/partials/customers/customers.controller.js +++ b/app/partials/customers/customers.controller.js @@ -61,17 +61,28 @@ CustomersService.getMargin().then(function(result) { $scope.marginList = result; }) + $scope.showCompanyError = false; + $scope.showMarginError = false; + + $scope.removeValidation = function(){ + console.log('key up'); + $scope.showCompanyError = false; + $('.companyNameInput').removeClass('customErrorInput'); + } + + $scope.removeMarginValidation = function(){ + $scope.showMarginError = false; + $('.marginSelectBox').removeClass('customErrorInput'); + } $scope.addFirstData = function(sel, step){ // console.log($scope.data) if($scope.data.companyName == undefined){ - toastr.error('Please enter Company Name', { - closeButton: true - }) + $scope.showCompanyError = true; + $('.companyNameInput').addClass('customErrorInput'); }else if($scope.data.masterMargin == undefined){ - toastr.error('Please select Master Margin', { - closeButton: true - }) + $scope.showMarginError = true; + $('.marginSelectBox').addClass('customErrorInput'); }else{ var companyData = "companyName=" + $scope.data.companyName + "&masterMargin=" + $scope.data.masterMargin + "&addressOne=" + $scope.data.addressOne + "&addressTwo=" + $scope.data.addressTwo + "&city=" + $scope.data.city + "&state=" diff --git a/app/partials/customers/customers.html b/app/partials/customers/customers.html index 59fdae2..c307216 100644 --- a/app/partials/customers/customers.html +++ b/app/partials/customers/customers.html @@ -238,14 +238,15 @@