Overview:
Here's what it looks like on html page.
So each row of checkboxes has it's different names, for example name="doctor_0[]"
, it increments every row. So the next row would be name="doctor_1[]"
their corresponding default value would be 0
So in eye friendly code view it would be
// First row
<td><input type="checkbox" name="doctor_0[]" class="day_cbox" value="0"></td>
<td><input type="checkbox" name="doctor_0[]" class="day_cbox" value="0"></td>
// Second row
<td><input type="checkbox" name="doctor_1[]" class="day_cbox" value="0"></td>
<td><input type="checkbox" name="doctor_1[]" class="day_cbox" value="0"></td>
and so on...
Now into the problem
My problem is when the checkbox aren't checked, the data isn't passed into $_POST
.
I know that normally it doesn't work that way, so the not-so-good alternative is to create input field of hidden
so it would get the value when the checkbox aren't check. But the problem is, this one's an array.
I've tried several solutions that was told in my questions that are similar to this below, but it doesn't work that way though. Well it's not meant to be dynamic or using arrays. Correct me if I'm wrong, my bad about that.
So, are there any solutions for this stuff?
A help or suggestion or advice would be good.
Thanks.
Questions that are similar to this.
Get values of unchecked checkboxes
Post the checkboxes that are unchecked
How get value for unchecked checkbox in checkbox elements when form posted?