title: Pass Value Onclick Checkbox to controller codeigniter
body: <p>I am new to CI and i am having issues in following code:
  My Controller shows all the values of countries dynamically from DB, i need to pass value onclicking particular chechbox to my controller</p>
  
  <p>My view:</p>
  
  <p></p>
  
  <pre><code>    &lt;/head&gt;
      &lt;body&gt;
      &lt;?php 
          foreach ( $countryDetails as $row ) 
          {
          echo '&lt;input id="country" type="checkbox" name="country" class="unique" value="'.$row-&gt;country_id.'" onclick=""&gt;'.$row-&gt;country_name.'&lt;br/&gt;';
          }
          ?&gt;
      &lt;script&gt;
      $('input.unique').click(function() {
      $('input.unique:checked').not(this).removeAttr('checked');
      });
      &lt;/script&gt;
      &lt;script&gt;
  </code></pre>
  
  <p>and my Controller is </p>
  
  <pre><code>public function index()
  {       
  $this-&gt;view_data['countryDetails'] = $this-&gt;get_county_model-&gt;getCountryDetails();
  
  
  $this-&gt;load-&gt;view('get_country' , $this-&gt;view_data );
  }
  </code></pre>