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
My view:
</head>
<body>
<?php
foreach ( $countryDetails as $row )
{
echo '<input id="country" type="checkbox" name="country" class="unique" value="'.$row->country_id.'" onclick="">'.$row->country_name.'<br/>';
}
?>
<script>
$('input.unique').click(function() {
$('input.unique:checked').not(this).removeAttr('checked');
});
</script>
<script>
and my Controller is
public function index()
{
$this->view_data['countryDetails'] = $this->get_county_model->getCountryDetails();
$this->load->view('get_country' , $this->view_data );
}