I have 3 tables say:-
invoice_details, customer_details and bill_address.
The invoice form has a dropdown and a checkbox. Customer names are listed in the dropdown from the customer table. And when I select a customer name the checkbox values must have the corresponding billId.
so when I mark the checkbox, the value of checkbox must be the billId of that customer name that has been selected. I hope my question is clear.
view page:-
<div class="row space">
<label class="control-label">Customer <span class="manda">*</span></label>
<select class="form-control" name="customerId" id="customerId">
<option value="0">Choose....</option>
<?php
if ($customer) {
foreach ($customer as $row) {
echo "<option value='".$row->customerId."'>".$row->customer_name."</option>";
}
} ?>
</select>
</div>
<div class="row space">
<div class="col-sm-6">
<input type="checkbox" name="checkbox" value="bill">
<label>Bill To</label>
</div>
</div>
How could I do this? please help me...
customerId is common in all 3 tables.
Table details:-
bill_address(billId, customerId, street, city, state, country).
customer_details(customerId, customer_name, phone, email,..).
invoice_details(invoiceId, customerId, billId, date, status,..).
foreach($BillTableDta as $bill) { $billData.='<input type="checkbox" name="billcheckbox" value="'.$bill.'">'; }as using for each 9 check box appears i need only one to appear. its working fine.