如何获取<form:select>的选定选项?

时间:2016-05-26 07:08:34

标签: spring-mvc html-select

<c:forEach var="bu" items="${brand.businessUnits}">
    <td class="dataText">
        <c:if test="${bu.marketCode == masterMarket}">
            <c:out value="${param.id}"></c:out>
            <form:select disabled='${disableDisplayType}' path="categories[${bu.marketCode}].categoryDisplayTypeId" cssClass="selectLrg">
                <form:option value="" />
                <form:options items="${categoryDisplayTypes}" itemLabel="name" itemValue="id" />
            </form:select>
            <c:out value="${param.id}"></c:out>
            <form:errors path="categories[${bu.marketCode}].categoryDisplayTypeId" cssClass="error" />
            <c:if test="${disableDisplayType}">
                <form:hidden path="categories[${bu.marketCode}].categoryDisplayTypeId" />
            </c:if>
        </c:if>
    </td>
</c:forEach>

这里我想根据从下拉控件中选择的类别获取categoryDisplayType。

1 个答案:

答案 0 :(得分:0)

$('# formName 选择[name =“ pathName ”]选项:已选中')。val();