Hi,
I have 2 fields Active and Name
if i have checked then Name field is mandatory else it's optional
after clicking of save button if everything is valid dispaly suceess message at paticular row
could you please help me
@{
Layout = null;
}
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<script type="text/javascript">
var app = angular.module("myApp", []);
app.controller("myCtrl", function ($scope, $http) {
$scope.employees = [{ Active: 0 }, { Active: 1}];
$scope.save = function () {
}
});
</script>
</head>
<body ng-app="myApp" ng-controller="myCtrl">
<table class="table table-bordered table-hover">
<thead>
<tr>
<th>Active</th>
<th>Name</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="employee in employees">
<td><input type="checkbox" ng-model="employee.Active" /></td>
<td><input type="text" ng-model="employee.Name" /></td>
</tr>
</tbody>
</table>
<button ng-click="Save()">Save</button>
</body>
</html>