我正在表单中设置一个动态行。需要从选择下拉列表中获取产品的价格。产品下拉列表中已经填充了数据库中的值。<?php function fill_unit_select_box($con){ $output =''; $query = "SELECT * FROM pricelist"; $result = $con->query($query); if ($result->num_rows > 0) { // output data of each row while($row = $result->fetch_assoc()) { $output .= '<option value="'.$row["product"].'">'.$row["product"].'</option>'; } return $output; }}?><div class="form-body pal"> <div class="row"> <div class="col-md-12 col-md-offset-10"> <div class="form-group"> <button type="button" class="btn btn-info add-new-product_record_details"><i class="fa fa-plus"></i> Add Product</button> </div> </div> </div></div><div class="form-body pal"> <div class="row"> <div class="col-md-12"> <div class="form-group"> <div class="table-responsive"> <table class="table table-striped table-bordered table-hover add_row" id="product_record_details"> <thead> <tr> <th class="success text-center">Product<span class='require'>*</span></th> <th class="success text-center">Price<span class='require'>*</span></th> <th class="success text-center">Delete</th> </tr> </thead> <tbody> <tr></tr> </tbody> </table> </div> </div> </div> </div></div>我需要的所以在更改产品时,它应该从数据库中获取产品的价格。自动乘以输入数量的价格例如:产品的提取价格为“2000”,我们输入的数量值为“2”,因此输出应显示为“4000”,此值要输入在价格栏中谢谢
添加回答
举报
0/150
提交
取消