我在保存到数据库时遇到了这个选择选项问题
这是我的代码
<div class="col-sm-2 control-label no-padding-right">
<div id="loantype">
<select class="form-group loan_type" id="loan_type form-field-2" name="loan_type" value="<?php echo set_value('loan_type');?>" required>
<option value="0">Select Loan Type</option>
<option value="Personal">Personal</option>
<option value="Business">Business</option>
</select>
</div>
</div>
<div class="col-sm-2 control-label no-padding-right">
<div class="personalloan" id="personalloan" style="display:none">
<select class="form-group loan_amount" id="loan_amount form-field-2" name="loan_amount" value="<?php echo set_value('loan_amount');?>" required>
<option value="0">Select Loan Amount</option>
<option value="10000">P10,000</option>
<option value="20000">P20,000</option>
<option value="30000">P30,000</option>
</select>
</div>
Business如果我选择将出现的话也是如此businessloan。但问题是只有选择选项businessloan中的数据被保存在数据库中,但是当我在personalloan其始终为 0 上选择某些内容时。
我这样保存
'loan_type' => $this->input->post('loan_type'),
'loan_amount' => $this->input->post('loan_amount'),
有什么问题?
子衿沉夜
叮当猫咪