1. 程式人生 > >js 手動設定表單值再提交

js 手動設定表單值再提交

html:

<form id="form1" method="post" th:action="@{/plan/startWorkOrderBatch}">(th:action 為thymeleaf的標籤)

<input id="workOrderIds" type="hidden" name="workOrderIds"/> 

</form>

js:

document.getElementById("workOrderIds").value=expectedStr;

$("#form1").submit();