【发布时间】:2025-12-03 00:20:19
【问题描述】:
在 HTML 中,select 标记具有 required 属性,该属性“指定用户需要在提交表单之前选择一个值”。 read here
在 Struts 1 中,“html:select”标签没有属性“required”:read here
在 Struts 1 中为选择框提交表单之前,如何指定用户需要选择一个值?
<td class="insdataheader">
<label for="initReqList[0].seqType">
<bean:message bundle="XYZ" key="it.myproject.cbi2.disposals.v000104.model.MndtInitiationRequestV02.seqType"/>
</label>
</td>
<td class="insdatitxt_inserita_nowrap" align="left">
<html:select property="initReqList[0].seqType" name="initReqList[0].seqType" styleId="initReqList[0].seqType" value="${dataEntryForm.initReqList[0].seqType}">
<html-ext:keyOptionsCollection bundle="XYZ" name="dataEntryForm" property="initReqList[0].seqTypeOptions" label="keyBundle"value="key"
</html:select>
</td>
【问题讨论】: