title: How can i get the different value of one group radio buttons while the form is loop and with only one submit button?
body: <p><a href="https://i.stack.imgur.com/0U2jk.png" rel="nofollow noreferrer">Please see the screenshot </a>Project for School: Voting System</p>
  
  <p>Can you please hep me on how can i get the value of radion buttons 'nominee' for every loop of the form. In each form the voter should vote only one of the candidate for example is for president. How can i get the vote for each positions (President, Vice President,etc) with only one submit button?</p>
  
  <p>Here's the code:</p>
  
  <pre><code>&lt;?php
  
  $readPos = new Voting();
  $rtnReadPos = $readPos-&gt;READ_POSITION($org);
  ?&gt;
  &lt;div class="container"&gt;
  &lt;div class="row"&gt;
      &lt;?php if($rtnReadPos) { ?&gt;
      &lt;div class="col-md-6 col-md-offset-3"&gt;
          &lt;?php
          if(isset($_POST['vote'])) {
              $org            = trim($_POST['org']);
              $pos            = trim($_POST['pos']);
              $candidate_id   = trim($_POST['nominee']);
              $voters_id       = trim($_POST['voter_id']);
  
  
              $insertVote = new Voting();
              $rtnInsertVote = $insertVote-&gt;VOTE_NOMINEE($org, $pos, $candidate_id, $voters_id);
          }
  ?&gt;
          &lt;div class="voting-con"&gt;
  
              &lt;br&gt;&lt;h4 style="text-align: center;"&gt;&lt;?php echo $org; ?&gt; Voting Page&lt;/h4&gt;&lt;hr /&gt;
              &lt;?php while($rowPos = $rtnReadPos-&gt;fetch_assoc()) { ?&gt;
              &lt;form action="&lt;?php $_SERVER['PHP_SELF']; ?&gt;" method="POST" role="form"&gt;
                  &lt;p class="help-block"&gt;&lt;b&gt;&lt;?php echo $rowPos['pos']; ?&gt;&lt;/b&gt;&lt;/p&gt;
                      &lt;?php
                      $readNominee = new Voting();
                      $rtnReadNominee = $readNominee-&gt;READ_NOMINEES($org, $rowPos['pos']);
                      ?&gt;
  
                      &lt;?php if($rtnReadNominee) { ?&gt;
                          &lt;div class="form-group"&gt;
                          &lt;?php while($rowNominee = $rtnReadNominee-&gt;fetch_assoc()) { ?&gt;
                          &lt;input class="form-control" type="radio" name="nominee" value="&lt;?php echo $rowNominee['id']; ?&gt;"&gt;&lt;?php echo $rowNominee['name']; ?&gt; &lt;/input&gt;&lt;br&gt;
  
                                  &lt;?php } //End while ?&gt;
                              &lt;!-- &lt;select name="nominee" class="form-control"&gt; 
                                  &lt;option value=""&gt;*****Select Nominee*****&lt;/option&gt;
                                  &lt;?php while($rowNominee = $rtnReadNominee-&gt;fetch_assoc()) { ?&gt;
                                  &lt;option value="&lt;?php echo $rowNominee['id']; ?&gt;"&gt;&lt;?php echo $rowNominee['name']; ?&gt;&lt;/option&gt;
                                  &lt;?php } //End while ?&gt; 
                              &lt;/select&gt;--&gt;
                          &lt;/div&gt;                      
                      &lt;?php } //End if ?&gt;
                      &lt;input type="hidden" name="org" value="&lt;?php echo $org; ?&gt;"&gt;
                      &lt;input type="hidden" name="pos" value="&lt;?php echo $rowPos['pos']; ?&gt;"&gt;
                      &lt;input type="hidden" name="voter_id" value="&lt;?php echo $_SESSION['ID']; ?&gt;"&gt;
  
                  &lt;?php
                  $validateVote = new Voting();
                  $rtnValVote = $validateVote-&gt;VALIDATE_VOTE($org, $rowPos['pos'], $_SESSION['ID'])
                  ?&gt;
  
              &lt;hr /&gt;
              &lt;?php } //End while ?&gt;
              &lt;button type="submit" name="vote"
                              &lt;?php if($rtnValVote-&gt;num_rows &gt; 0) { ?&gt;
                              &lt;?php echo "class='btn btn-default disabled'&gt;"; ?&gt;
                              &lt;?php } else { ?&gt;
                              &lt;?php echo "class='btn btn-info'&gt;"; ?&gt;
                              &lt;?php } //End if ?&gt;
                          Vote
                      &lt;/button&gt;
              &lt;/form&gt;
  
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;?php } //End if ?&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p></p>