是否有任何方法可以在MySQl表中保存禁用选择选项的值和禁用复选框的值。我已经试过了。Readonly可以很好地处理文本框,而不是下拉和复选框。这里是部分html代码。
<tr>
<td width=241>First Name :
<input type="text" name="child_name" id="reg_no" value="<?php echo $row->eq_name;?>" readonly/></td>
<td align="center">Middle Name :
<input type="text" name="mid_name" id="reg_no" value="<?php echo $row->mid_name;?>" readonly/></td>
<td width="250" colspan="2">Last Name :
<input type="text" name="last_name" id="reg_no" value="<?php echo $row->last_name;?>"readonly /></td>
<td></td>
</tr>
<tr>
<td> Category</td>
<td><input type="text" id="cast_cate" name="cast_cate" value="<?php echo $row->scat_id;?>" readonly/>
BPL <input type="checkbox" id="bpl" name="bpl" value="<?php echo $row->e_bpl;?>" <?php if($row->e_bpl=="Yes"){?> checked<?php } ?> readonly />
EWS <input type="checkbox" id="ews" name="ews" value="<?php echo $row->e_ews;?>" <?php if($row->e_ews=="Yes"){?> checked<?php } ?> readonly />
SGC <input type="checkbox" id="sgc" name="sgc" value="<?php echo $row->e_sgc;?>" <?php if($row->e_sgc=="Yes"){?> checked<?php } ?> readonly />
</td>
<td width="158">
Handicap<input type="checkbox" id="handi" name="handi" value="<?php echo $row->ehandi;?>" <?php if($row->ehandi=="Yes"){?> checked<?php } ?> readonly />
</td>这是PHP代码-
$q2="insert into es_preadmission(pre_fname,m_name,pre_lname,pre_scat_id,pre_handi,pre_ews,pre_sgc,pre_bpl) values('".ucfirst($_POST['eq_name'])."','".$_POST['mid_name']."','".ucfirst($_POST['last_name']).$_POST['cast_cate']."','".$handicap."','".$ews."','".$sgc."','".$bpl."','".$_POST['house']."')";
$log_insert_exe=mysql_query($q2) or die(mysql_error());我欢迎任何意见/建议
发布于 2014-02-07 15:30:31
禁用意味着它将不会提交,我不确定,但我不认为有只读选项和inputtype=“复选框”。您可以在屏幕上呈现禁用的,但您需要在隐藏的输入中推送值来提交它们。
<input type="checkbox" value="test" name="test_display" /> // will be displayed
<input type="hidden" name="test" value="test" /> // will be postedhttps://stackoverflow.com/questions/21631354
复制相似问题