【发布时间】:2020-08-08 18:17:48
【问题描述】:
我有 3 张桌子说:-
invoice_details、customer_details 和 bill_address。
发票表单有一个dropdown 和一个checkbox。 Customer names 列在customer table 的下拉列表中。当我选择customer name 时,复选框值必须具有相应的billId。
所以当我标记复选框时,复选框的值必须是已选择的客户名称的billId。我希望我的问题很清楚。
查看页面:-
<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>
我怎么能这样做?请帮帮我...
customerId 在所有3 tables 中都很常见。
表格详情:-
bill_address(billId, customerId, street, city, state, country).
customer_details(customerId, customer_name, phone, email,..).
invoice_details(invoiceId, customerId, billId, date, status,..).
【问题讨论】:
-
你知道codeigniter中的ajax???
-
你的问题解决了吗,请告诉我?
-
是的,先生,我知道 ajax。
-
是的,先生,我找到了解决方案。谢谢@KUMAR。但是我对代码做了一些更改。
foreach($BillTableDta as $bill) { $billData.='<input type="checkbox" name="billcheckbox" value="'.$bill.'">'; }使用每个 9 复选框出现我只需要一个出现。它工作正常。 -
好的,很高兴听到它为您工作。
标签: php html codeigniter