![](/img/trans.png)
[英]Jquery/Javascript issue on checkbox checked add row from one table to another with input box manipulation
[英]JSP dynamic table with one input box and one checkbox in each row
我現在正在設計包含一個動態表的 .jsp,數據將從數據源中檢索(這無關緊要)。 要求與我的主題相同。 我已經完成了部分代碼,但未能獲得用戶輸入值。
我的代碼如下:
<form id="select" method="post" action="select">
<h2 style="text-align: center;">Plan List</h2>
<p style="width: 100%; text-align: center;">
<button type="submit"
>Select</button>
</p>
<table class="details">
<tr class="details">
<th class="details" style="text-align: center;">Plan Name</th>
<th class="details" style="text-align: center;">Quota</th>
</tr>
<c:forEach items="${list}" var="plan">
<tr class="details">
<td class="details" style="text-align: center;">${plan.planName}</td>
<td class="details" style="text-align: center;"><input
type="text" name="quota2" min="1"></td>
<td class="details"><input type="checkbox" name="selection2"
value="${selectedPartnerId},${plan.planId}" /></td>
</tr>
</c:forEach>
</table>
設計是通過單擊復選框來選擇行,然后單擊選擇按鈕提交所選行。 我現在可以通過將變量賦值來傳遞數據。 但是,我找不到任何方法來傳遞屬於用戶輸入的值。 我已經為此花了兩天時間。 請給我一些建議。 非常感謝您的寶貴時間......
有關您信息的更多詳細信息...我現在使用 java 作為后端並通過“request.getParameterValues("selection2")”獲取選定的復選框結果列表...
我已經通過使用相同的獲取方法自己解決了這個問題。 但是,我會傳遞表的索引號以獲得相應的配額值(這是用戶輸入的)。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.