How can I differentiate checkboxes row-wise when trying to insert table values into the rows in HTML?
<div class="col-md-8" ng-controller="checklistController" ng-init='populateChecklist(<%=request.getParameter("id")%>)'>
<div class="table-responsive">
<table class="table table-bordered">
<thead>
<tr>
<th>Checklist Name</th>
<th>Not Required</th>
<th>Completed</th>
<th>Link</th>
</tr>
</thead>
<tbody>
<tr ng-repeat = "x in list">
<td>{{x.name}}</td>
<td><input type="checkbox" ng-model='notRequiredCheckList' ng-disabled="completedCheckList" ng-disabled="linkForCheckList"/></td>
<td><input type="checkbox" ng-disabled="notRequiredCheckList" ng-model="completedCheckList" /></td>
<td><input type="text" ng-model="linkForCheckList" size="50" ng-disabled="notRequiredCheckList"/></td>
</tr>
</tbody>
</table>
</div>
<button type"button" ng-click="savelist(list)">Send</input>
<div>
Javascript:
app.controller("checklistController",function($scope,$http){
$scope.populateChecklist = function(a){
$http.get("commonAppGet.jsp?sqlStr=select name from checklist where
where id="+a).then(function(resp){
$scope.list = resp.data;
});
}
$scope.savelist = function(list){
$scope.res=list;
alert($scope.res.length);
alert($scope.res[0].name);
alert($scope.res[1].name);
}
});
How can I fetch the checkbox values for each row and send the data to the server for storage in the database using JSP?