0

我在将 selectpicker 的值发送到 codeigniter 中的控制器时遇到问题,谁能告诉我如何获取 selectpicker 的选定值并将其传递给控制器​​以进行进一步处理。

这是我的代码:-

<!--    <form action="" method="POST">  -->
                <?php $data = array(
                    'id'=>'inventory_form', 
                    ); ?>
                <?php  echo form_open('main/store',$data); ?>
               <div class="table-responsive">
                    <table class="table table-bordered table-hover" id="inv_tbl">
                        <thead>
                            <th>No</th>
                            <th>~</th>
                            <th>Barcode</th>
                            <th>Product Name</th>
                            <th>SM</th>
                            <th>SPL</th>
                            <th>Quantity</th>
                            <th>Price</th>
                            <th>Discount</th>
                            <th>Amount</th>
                            <th><input type="button" value="+" id="add" class="btn btn-primary add_inv_row"></th>
                        </thead>
                        <tbody class="detail">
                            <tr>
                                <td class="no">1</td>
                                <td class="text-center"><input type="checkbox" class="is_checked" name="till_check[]" value="Bike"></td>

                                <td>
                                    <select name="barcode[]" id="brcode" class="form-control selectpicker barcode" data-live-search="true">
                                    <option value="">Please select a barcode</option>
                                    <?php  foreach($barcodes as $barcode) :?>
                                    <option value="<?php echo $barcode->barcode; ?>"><?php echo $barcode->barcode; ?></option>
                                    <?php endforeach; ?>
                                    </select>
                                </td>
                                <td><input type="text" id="brcode_product" class="form-control productname" name="productname[]"></td>
                                <td>
                                    <select name="sm[]" id="sm" class="form-control selectpicker sm" data-live-search="true">
                                    <option value="">Please select a Employee code</option>
                                    <?php  foreach($employee_codes as $employee_code) :?>
                                    <option value="<?php echo $employee_code->emp_code; ?>"><?php echo $employee_code->emp_code; ?></option>
                                    <?php endforeach; ?>
                                    </select>
                                </td>
                                <td><input type="text" class="form-control spl" name="spl[]"></td>
                                <td><input type="text" class="form-control quantity" name="quantity[]"></td>
                                <td><input type="text" class="form-control price" name="price[]"></td>
                                <td><input type="text" class="form-control discount" name="discount[]"></td>
                                <td><input type="text" class="form-control amount" name="amount[]"></td>
                                <td><a href="#" class="remove">Delete</a></td>

                            </tr>
                        </tbody>
                        <tfoot>
                            <th></th>
                            <th></th>
                            <th></th>
                            <th></th>
                            <th></th>
                            <th></th>
                            <th></th>
                            <th></th>

                            <th class="text-center"><button class="btn btn-success" id="save_btn" type="submit" name="sale_submit_btn">Save</button></th>
                            <th style="text-align:center;" class="total">0<b></b></th>

                        </tfoot>

                    </table>




                </div> 



                <?php echo form_close(); ?>
                <!--</form>-->
4

0 回答 0