Hello,
I'm having trouble with html/php.
I have a bunch of checkboxes on a page, so I decided to use an array instead of having seperate names per checkbox:
<input type="checkbox" name="chkos[] value="41">
However when I read the $chkos array after the POST I only get "on" values instead of my real value, 41 in this case.
When I give my checkboxes a unique name it does give the right value.
I guess this must be html related ? But is there a workaround ?
$numrows = count($chkos);
for ($i=0; $i < $numrows; $i++) {
echo "value is: " . $chkos[$i] ."<br>";
}
With 3 checkboxes checked it displays:
value is: on
value is: on
value is: on
And I would expect / need:
value is: 41
value is: 41
value is: 41
Any ideas/workarounds ?
Thanks in advance