2
我有這個隱藏字段:如何使用來自隱藏字段的數據設置th.action?
<input type="hidden" id="controllerName" name="controllerName" value="nnnn"/>
其中包含將由形式被稱爲控制器名稱。 而且基本上是我需要做的是這樣的:
<form role="form"
th:action="${controllerName} + @{/deleteAssignment}"
name="assignmentDeleteForm"
id="assignmentDeleteForm" method="post">
</form>
我希望把我的價值在這個隱藏字段爲日:與@{/deleteAssignment}
串聯作用。
這個網頁是一個模式,所以我對JavaScript設置隱藏字段這樣的:
modal.find('#controllerName').val(controller);
我不能設置動作直接形成的JavaScript,因爲它失去了上下文,然後失敗。