Hi There,
I am creating a quotation form with check boxes and input fields for the quantity.
My problem is that if the user selects checkbox 1 and 3 and enters the quantity for these items then when the posting is done this is my result.
As you can see TEXT_0 has values
[0] => 12
[1] =>
[2] => 34
But the CHECK0 has
[0] => Shirt1
[1] => Shirt3
* [1] is supposed to be empty same as TEXT_0 and [2] is supposed to have value "Shirt3"
How can i make sure that the checkboxes return corresponding values as my input box so that i dont get only 2 values but all 3 even if the second checkbox is NOT selected ?
below is my partial code for the form
Thanks
I am creating a quotation form with check boxes and input fields for the quantity.
My problem is that if the user selects checkbox 1 and 3 and enters the quantity for these items then when the posting is done this is my result.
$_POST Array: Array ( [text_name] => Myname [text_email] => test@test.com [text_number] => 0988 [text_0] => Array ( [0] => 12 [1] => [2] => 34 ) [check0] => Array ( [0] => Shirt1 [1] => Shirt3 ) [text_1] => Array ( [0] => [1] => ) [text_2] => Array ( [0] => [1] => 123 [2] => [3] => ) [check2] => Array ( [0] => Shoe2 ) [button_11] => Submit [1fdf275d75ded6d29c01ef6c329508a7] => 1 [1cf1] =>
As you can see TEXT_0 has values
[0] => 12
[1] =>
[2] => 34
But the CHECK0 has
[0] => Shirt1
[1] => Shirt3
* [1] is supposed to be empty same as TEXT_0 and [2] is supposed to have value "Shirt3"
How can i make sure that the checkboxes return corresponding values as my input box so that i dont get only 2 values but all 3 even if the second checkbox is NOT selected ?
below is my partial code for the form
foreach ($t_rows2 as $itemnames) {
$tloop = $tloop + 1;
?>
<td width=300 NOWRAP align=left> <?php echo "$itemnames"; ?> </td>
<td width=50 NOWRAP align=left> <input class="cf_inputbox" maxlength="5" size="3" title="" id=<?php echo '"text_'.$checkb.'[]"'; ?> name=<?php echo '"text_'.$checkb.'[]"'; ?> </td>
<td width=25 NOWRAP align=left> <input value=<?php echo '"'.$itemnames.'"' ; ?> title="" class="radio" id=<?php echo '"'.$catnames.$tloop.'"' ?> name=<?php echo '"check'.$checkb.'[]"'; ?> type="checkbox" /> </td>
</tr>
<?php }
Thanks