title: Radio button input not working in bootstrap
body: <p>I am submitting a form containing radio button inputs. It works if I remove the 'class' attribute  from the radio button inputs (or display without the bootstrap template), but not otherwise.</p>
  
  <p>If you <a href="http://myhelpinghandonline.com/272/gurnoorproducts.php" rel="nofollow noreferrer">click any star here</a> and submit, rating is null. Corresponding PHP code to generate HTML form (same in both links): 
  test_ratings_curl.php</p>
  
  <p><div class="snippet" data-lang="js" data-hide="true" data-console="true" data-babel="false">
  <div class="snippet-code snippet-currently-hidden">
  <pre class="snippet-code-js lang-js prettyprint-override"><code> &lt;? php
   print('       &lt;form method="post" action="rating_curl.php"&gt;
                &lt;span class="rating"&gt;');
   $rating = 4;
   $inp_no = 1;
   print('&lt;input type="hidden" name="Name" value="arya" /&gt;');
   for ($k = 1; $k &lt;= $rating; $k++) {
     $inp_no = $k;
     $to_print = '&lt;input type="radio" class="rating-input" id="rating_input_'.strval($k).
     '" name="rating_input_'.strval($k).
     '" value="rating_input_'.strval($k).
     '" &gt;
                  &lt;label for="rating_input_1_'.strval($k).
     '" class="rating-star1"&gt;&lt;/label&gt;';
     print($to_print);
   }
   for ($j = $inp_no + 1; $j &lt;= 5; $j++) {
     $to_print = '&lt;input type="radio" class="rating-input" id="rating_input_'.strval($j).
     '" name="rating_input_'.strval($j).
     'value="rating_input_'.strval($k).
     '" &gt;
                  &lt;label for="rating_input_1_'.strval($j).
     '" class="rating-star"&gt;&lt;/label&gt;';
     print($to_print);
  
   }
  
   print('  &lt;/form&gt;
                  &amp;nbsp;');
   print('    
          &lt;input type="submit" name="rating_submit"&gt;
          &lt;/span&gt;'); ?&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>But <a href="http://myhelpinghandonline.com/272/test_rating_curl.php" rel="nofollow noreferrer">here</a> rating is returned.</p>
  
  <p>(Both have the same HTML):
  <div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;form method="post" action="rating_curl.php"&gt;
    &lt;span class="rating"&gt;
                &lt;input type="hidden" name="Name" value="arya"&gt;
  
                &lt;input type="radio" class="rating-input" id="rating_input_1" name="rating_input_1" onclick="check(this.id)" value="rating_input_1"&gt;
                  &lt;label for="rating_input_1_1" class="rating-star1"&gt;&lt;/label&gt;&lt;input type="radio" class="rating-input" id="rating_input_2" name="rating_input_2" onclick="check(this.id)" value="rating_input_2"&gt;
                  &lt;label for="rating_input_1_2" class="rating-star1"&gt;&lt;/label&gt;&lt;input type="radio" class="rating-input" id="rating_input_3" name="rating_input_3" onclick="check(this.id)" value="rating_input_3"&gt;
                  &lt;label for="rating_input_1_3" class="rating-star"&gt;&lt;/label&gt;&lt;input type="radio" class="rating-input" id="rating_input_4" name="rating_input_4" onclick="check(this.id)" value="rating_input_3"&gt;
                  &lt;label for="rating_input_1_4" class="rating-star"&gt;&lt;/label&gt;&lt;input type="radio" class="rating-input" id="rating_input_5" name="rating_input_5" onclick="check(this.id)" value="rating_input_3"&gt;
                  &lt;label for="rating_input_1_5" class="rating-star"&gt;&lt;/label&gt;
            &lt;input type="hidden" id="answer" name="answer"&gt;
            
                  &amp;nbsp;       (43)         
          &lt;input type="submit" name="rating_submit"&gt;
          &lt;/span&gt;
  &lt;/form&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Code for extracting POST variables (rating_curl.php):</p>
  
  <p><div class="snippet" data-lang="js" data-hide="true" data-console="true" data-babel="false">
  <div class="snippet-code snippet-currently-hidden">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>&lt;? php
  extract($_POST);
  
  $rating = null;
  if (isset($rating_input_1)) {
    $rating = "1";
  }
  elseif(isset($rating_input_2)) {
    $rating = "2";
  }
  elseif(isset($rating_input_3)) {
    $rating = "3";
  }
  elseif(isset($rating_input_4)) {
    $rating = "4";
  }
  elseif(isset($rating_input_5)) {
    $rating = "5";
  }
  print('Inside rating_curl.php&lt;br/&gt;');
  print("rating= ".$rating);
  print('&lt;br/&gt;');
  print('hidden: '.strval($answer));
  print('&lt;br/&gt;');
  print("name of product = ".$Name);
  $ch = curl_init();
  $post = 'name='.$Name.
  '&amp;rating='.$rating;
  curl_setopt($ch, CURLOPT_URL, 'gurnoors.com/rating.php');
  curl_setopt($ch, CURLOPT_POST, true);
  curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  $contents = curl_exec($ch);
  
  print('&lt;br/&gt;Curl Results: &lt;br/&gt;');
  print($contents);
  
  
  ?&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Conclusion:
  As stated by the accepted answer,  value of <code>label</code>'s attribute <code>for</code> must be the same as <code>id</code> of <code>input</code>. Thank you.</p>