制作一个新工具并需要一个下拉菜单,但它似乎不像我编码的那样工作。
不确定到底是什么问题。已经在网上研究过,但我一直无法弄清楚。
if(!isset($_POST["ReasonList"]))
{
$error .= '<p><label class="text-danger">Please select a reason</label></p>';
}
<div class="form-group">
<label>Select Reason for Request</label>
<select id="ReasonList" name="ReasonList" class="form-control" value="<?php echo $ReasonList; ?>" />
<option value = "">Select...</option>
<option value = "1">Original Engineer has left the company</option>
<option value = "2">Actively involved in field work on customer site</option>
<option value = "3">No capacity due to customer mandated deadlines</option>
<option value = "4">Exception request by manager</option>
</select>
</div>
如果选择了选项,则可以提交表单。如果没有选择选项,它会在 if 语句中给出错误 - 请选择一个原因
慕的地6264312