0
我正在使用JQuery
對話框來顯示<form:form>
以標識/選擇要從查詢添加的特定記錄。表格中的每個記錄都應該包含一個按鈕,作爲所述表格的觸發器以添加所選記錄。下面的代碼說明了代碼的結構:Spring Roo單表單多表單提交數值提交ID
<form:form action="POST" action="form_action" modelAttribute="form">
<div><form:hidden path="selectedDate" />
<!-- Other components relating to the parent record -->
</div>
<div>
<!-- The detail of the parent -->
<table>
<thead>
<th>Name</th>
<th></th>
</thead>
<tbody>
<c:forEach items="${items}" var="itr">
<tr>
<td>${itr.name}</td>
<td>
<input type="submit" value="Select" name="${itr.id}" />
</td>
</tr>
</c:forEach>
</tbody>
</table>
</div>
</form:form>
有沒有辦法讓id
後參數來表示所選擇的記錄?
有沒有一種方法的價值可以'提交'而不是'$ {itr.id}'? –
皮膚有很多種方法去皮膚。但是,將按鈕的值設置爲「提交」意味着後端將接收「form.items」的值爲「Submit」的值。如果你想讓按鈕仍然有這個值(不知道爲什麼,但確定),那麼你很可能必須有一個隱藏的領域,或者可能有多個隱藏的領域,並讓它的價值後端而不是按鈕,只需使用按鈕觸發提交。 – CodeChimp