Облицовочного выпуск, чтобы получить несколько значений флажка массива в Codeigniteвопроса, чтобы получить несколько массив значений флажка CodeIgniter
<div class="form-actions">
<form action="candidates/posted" name="posted" method="post">
<button class="btn btn-primary" type="submit" value="submit" name="submit">Action</button>
</div>
<table class="table table-striped table-bordered table-condensed">
<thead>
<tr>
<th class="header">#</th>
<th class="checkbox">Status</th>
<th class="yellow header headerSortDown">Roll No</th>
<th class="green header">Class Name</th>
<th class="red header">Full Name</th>
<th class="red header">Father Name</th>
<th class="red header">Sections</th>
<th class="red header">Actions</th>
</tr>
</thead>
<tbody>
<?php
foreach($candidates as $row)
{
echo '<tr>';
echo '<td>'.$row['id'].'</td>';
//echo '<td>' .'</td>';
echo '<td><input type="checkbox" class ="chkCheckBoxId" value='.$row['id'].' name="chk_id[]"/></td>';
echo '<td>'.$row['roll_no'].'</td>';
echo '<td>'.$row['class_name'].'</td>';
echo '<td>'.$row['full_name'].'</td>';
echo '<td>'.$row['father_name'].'</td>';
echo '<td>'.$row['section_name'].'</td>';
echo '<td class="crud-actions">
<a href="'.site_url("admin").'/candidates/update/'.$row['id'].'" class="btn btn-info">view & edit</a>
<a href="'.site_url("admin").'/candidates/delete/'.$row['id'].'" class="btn btn-danger">delete</a>
</td>';
echo '</tr>';
}
?>
</form>
контроллера здесь:
public function posted()
{
if(!empty($_POST['chk_id'])) {
foreach($_POST['chk_id'] as $check) {
echo $check;
}
}
}
Возможный дубликат http://stackoverflow.com/questions/4997252/get-post-from-multiple-checkboxes – Naincy
Да, я проверил много ответов на свой код, но не смог получить значения. –
где is form submit ..... share full code ... – Naincy