trig_1 0 Newbie Poster

i am repeating a form using ng-repeat. the repetition is to create a new form. i want to submit all forms data on single click. i am not able to find how i can assign multiple values in array.

Here is my form.

<div id="check" ng-repeat="screen in screens">
                       <input type="hidden" name="scrnid" ng-model="screen.scrnid" value="{{ screen.scrnid }}" />
                <input type="text" ng-model="screen.bdayname" placeholder="Name" ng-required/>
                <input type="date" ng-model="screen.bdaydate" placeholder="Date" ng-required/>

                   <button class="btn" type="submit" ng-click="newBirthday()">Save</button>
    <div class="container">
            <input type="button" class="btn" ng-click="createScreen()" /><i class="icon-plus"></i>Add

     // and it is my controller

    app.controller('main', function($scope){ 

        $scope.screens = [{scrnid: "1"}];
      $scope.scrnid = 1;
        $scope.createScreen = function(){
                $scope.screens.push({scrnid: "" + ($scope.screens.length + 1)});            

            $scope.bdays = [];        

        $scope.newBirthday = function(){        

            $scope.bdays.push($scope.screens.length);  // how to push mutiple records in array dynamically

            $scope.screen.bdayname = '';
            $scope.screen.bdaydate = '';


Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.