I have a form in which on click of button input fields get appended. The form is as below.
<body data-ng-app="myApp" data-ng-controller="myController" >
<form name="educdetailsform" novalidate>
<label>Education Details</label></br>
<button ng-click="addfield()">Add Education</button>
<div ng-repeat="item in items">
<input type="text" name="qualification[]" data-ng-model="empData.qualification[]" placeholder="Qualification">
<input type="text" name="year[]" data-ng-model="empData.year[]" placeholder="Year of Passing">
<input type="text" name="percentage[]" data-ng-model="empData.percentage[]" placeholder="Percentage">
</div>
<input type="submit" name="submit" ng-click="saveUser()" />
</form>
</body>
The angular JS code for appending input fields is as follows
var module=angular.module('myApp',[]);
module.controller('myController',function($scope, $http){
$scope.items = [{}];
$scope.addfield = function(){
$scope.items.push({});
}
});
This is the code and functionality http://jsfiddle.net/b0jtqzpj/2/
How to get the fields to saveUser() function and then save the data into database table using PHP Like, if the user has entered 3 entries i.e, the first entry must be saved in a row and 2nd entry in next row and 3rd entry in 3rd row. i.e, if 3 entries are entered in html form and submitted, 3 entries must be created in database table.
How do I catch data in angularjs saveUser() function and then save in database using PHP