I have an invoice in a HTML table. You select item name then item lot and the item #. There is a check box at the end to mark if it is sold out.
<input type="checkbox" name="soldout[]">
When I process the form the $_POST array of check boxes obviously don't contain the unchecked boxes. That leads me to problems when matching up the check boxes to the item
foreach($productID as $key=>$id){
$p = $id;
if(isset($soldout[$key])){
$so = true;
}
}
So if I have three line items and the first and last are marked sold out it processes as the first 2 sold out and the last one not sold out.
I don't think i can do this:
<input type="checkbox" name="soldout[<?php echo $i; ?>]">
because I am adding empty invoice lines with javascript when needed and wouldn't know how to increment the array key.
Any ideas on how to handle this?