I have rows with a dynamic radio buttons for each. This is how it looks on the view part initial value of each row shows the current one saved on the database
I've been trying to make the update button work whenever a user wants to update one's status (per row), I'm not making any progress.
The code on the view part is as follows:
if ($row['STATUS'] == 'Active') {
echo "<td>
<input type='radio' value='Active' name='status' id='status' checked/><label>Active</label>
<input type='radio' value='Inactive' name='status' id='status' /><label>Inactive</label>
";
} else {
echo "<td>
<input type='radio' value='Active' name='status' id='status' /><label>Active</label>
<input type='radio' value='Inactive' name='status' id='status' checked/><label>Inactive</label>";
}
Please note that the code above is inside a foreach loop. I'm starting to think that this foreach loop has someething to do on why it only gets the last value returned by the result_array().
I even tried using JavaScript on the view part for the values of the radio buttons, but I can't seem to make it work as well.
Please help. Thanks.