Shiv Kumar Yadav

Shiv Kumar Yadav

  • NA
  • 269
  • 25k

Validation In MVC and Angularjs

Feb 17 2018 6:18 AM
Hi,
 
I am Posting My data on controller using Angularjs Now i want to Validate on Some Fields Can Some One Help me How can i do that.
 
 Angularjs 
  1. $scope.savedata = function () {  
  2.     $scope.btn = true;  
  3.     $http({  
  4.         method: 'POST',  
  5.         url: '@Url.Action("LRData","GRPO")',  
  6.         data: { 'Docentry': $scope.grpo, 'batch': $scope.b }  
  7.     }).success(function (data) {  
  8.         alert(data);  
  9.     });  
  10. }  
 Html
  1.     <table class="table table-bordered table-hover">  
  2.         <thead class="thead-dark">  
  3.             <tr>  
  4.                 <th>Item Code</th>  
  5.                 <th>Description</th>  
  6.                 <th>Quantity</th>  
  7.                 <th>Batch No</th>  
  8.                 <th>LR No</th>  
  9.                 <th>LR Date</th>  
  10.             </tr>  
  11.         </thead>  
  12.         <tbody>  
  13.             <tr ng-repeat="t in b">  
  14.                 <td class="bg-color">{{t.ItemCode}}</td>  
  15.                 <td class="bg-color">{{t.Description}}</td>  
  16.                 <td class="bg-color">{{t.Qty}}</td>  
  17.                 <td class="bg-color">{{t.Batch}}</td>  
  18.                 <td><input type="text" ng-model="t.LrN" class="form-control" /></td>  
  19.                 <td><input type="date" ng-model="t.LrD" class="form-control" /></td>  
  20.             </tr>  
  21.         </tbody>  
  22.     </table>  
  23.   
  24.   
  25. <input type="button" value="Save" class="btn btn-outline-primary" ng-click="savedata()" ng-disabled="btn" />  

 please Help me will be vary thakful

Answers (1)