Having read many posts I can't find a solution to my issue, can you help please.
I am working on a scripts that has a FORM which contains dynamically generated checkbox's
When a checkbox is selected the form posts the result as "0". That work fine but if the checkbox is not selected I need the form post result to be "1".
My code: The checkbox's are dynamically generated from a MySQL query and can be any number of checkbox's depending on how many rows are returned by the query.
<?php do { ?>
<tr>
<td width="13%" class="seqid"><?php echo $row_TQ01['SeqID']; ?></td>
<td colspan="2" align="left" class="audititems"><?php echo $row_TQ01['SeqText']; ?></td>
<td>
<input name="check[<?php echo $row_TQ01['SeqID']; ?>]0" type="checkbox" class="checkbox" value="0" id="check0"/>
</td>
</tr>
<?php } while ($row_TQ01 = mysql_fetch_assoc($TQ01)); ?>
If I select the checkbox reresults is:
Array ( [auditdate] => 2016-07-05 16:11 [HotelID] => NXLHR [AuditBy] => Demo [check] => Array ( [SeqID4901] => 0 [SeqID4902] => 0 [SeqID4903] => 0 ) [Comments] => [button] => Submit [MM_insert] => form1 [Room] => 0108 [clientID] => 1085 [SavedState] => 1 [SavedTableID] => 49 [UniqueID] => NXLHR01081467731479 )
If I do not select the check bos the result is:
Array ( [auditdate] => 2016-07-05 16:12 [HotelID] => NXLHR [AuditBy] => NaveX Demo [Comments] => [button] => Submit [MM_insert] => form1 [Room] => 0108 [clientID] => 1085 [SavedState] => 1 [SavedTableID] => 49 [UniqueID] => NXLHR01081467731479 )
Can anyone see a way of making the non select checkbox have a value of "1".
Many thanks in advance for your time.