I want the code below to be able to post form data to server backend. I 
know how to handle the PHP backend code. can someone help me out. Thanks


<html>
   <head>
      <script src = 
"https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js";></script>
      
 
      
   </head>
   <body>
      
      <div ng-app = "mainApp" ng-controller = "testController">
         
         <form name = "testForm">

<b>Firstname</b><br>
<input name = "firstname" type = "text" ng-model = "firstName" required>

<br>
<b>Lastname</b><br>
<input name = "lastname"  type = "text" ng-model = "lastName" required>

<br>
<b>Email</b><br>
<input name = "email" type = "email" ng-model = "email" length = "100" 
required>
<br><br>
  <button ng-click = "reset()">Reset</button>
<button ng-click="submit()">Submit</button>
</form>

                  
      </div>
      
      <script>
         var mainApp = angular.module("mainApp", []);
         
         mainApp.controller('testController', function($scope) {
            $scope.reset = function() {
//addrecord.php;

               $scope.firstName = "Ann";
               $scope.lastName = "Joyce";
               $scope.email = "my email goes here";
            }
            
            $scope.reset();
         });
      </script>
      
   </body>
</html>

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/angular/6241a20f-b552-4222-b6ac-00a5f3571c50n%40googlegroups.com.

Reply via email to