title: Upon clicking one checkbox, all are being selected
body: <p>I am making a form with html pdo and has angular js for validation but the section where i need checkbox upon click one box rest of the checkboxs are also getteng check</p>
  <p>my form</p>
  <pre><code>&lt;input type=&quot;checkbox&quot; name=&quot;declaration&quot; id=&quot;declaration&quot; ng-model=&quot;formData.decl&quot;  /&gt; 1 data&lt;br/&gt;
       
  &lt;input type=&quot;checkbox&quot; name=&quot;declaration&quot; id=&quot;declaration&quot; ng-model=&quot;formData.decl&quot; /&gt; 2 data&lt;br/&gt;
  </code></pre>
  <p>here is the insert.php</p>
  <pre><code>///////////////////////
  if(empty($form_data-&gt;decl))
  {
   $error[] = 'Choosing declaration is required';
  }
  else
  {
   $declaration = $form_data-&gt;decl;
  }
  
  $data = array(
   ':declaration' =&gt; $declaration
  );
  
  if(empty($error))
  {
   $query = &quot;
   INSERT INTO tbl 
   (declaration) VALUES 
   (:declaration)
   &quot;;
   $stmt = $db-&gt;prepare($query);
   if($stmt-&gt;execute($data))
   {
    $message = 'Data Added';
   }
  }
  else
  {
   $validation_error = implode(&quot;, &quot;, $error);
  }
  
  $output = array(
   'error'  =&gt; $validation_error,
   'message' =&gt; $message
  );
  
  echo json_encode($output);
  </code></pre>
  <p>and here is the complete angular js</p>
  <pre><code>var app = angular.module('dynamicApp', []);
  app.controller('dynamicController', function($scope, $http){
  
   $scope.success = false;
   $scope.error = false;
   
   $scope.rows = [{name: 'travel_details[]', name: 'remove'}];
   $scope.addRow = function(){
    var id = $scope.rows.length + 1;
    $scope.rows.push({'id':'dynamic'+id});
   };
  
   $scope.removeRow = function(row){
    var index = $scope.rows.indexOf(row);
    $scope.rows.splice(index, 1);
   };
  
   $scope.formData = {};
  
   $scope.submitForm = function(){
    $http({
     method:&quot;POST&quot;,
     url:&quot;insert.php&quot;,
     data:$scope.formData
    }).success(function(data){
     if(data.error != '')
     {
      $scope.success = false;
      $scope.error = true;
      $scope.errorMessage = data.error;
     }
     else
     {
      $scope.success = true;
      $scope.error = false;
      $scope.successMessage = data.message;
      $scope.formData = {};
      $scope.rows = [{holder_name: 'travel_details[]', holder_name: 'remove'}];
      $scope.fetchData();
     }
    });
   };
  
  });
  </code></pre>
  <p>I see the portion ng-model=&quot;formData.decl&quot;  in the checkbox area is causing this issue. if I remove this then only single checkbox gets clicked but then form validation would not work.</p>
  <p>Can someone help me out with this issue?</p>
  <p>Thanks alot</p>