0
有沒有辦法在同一個表單標籤中有POST和DELETE請求?我有一張桌子,我想在選擇時刪除那一行。以相同的形式刪除和POST
我似乎只能得到一個,但不能同時工作。我在後端使用Node.js和MySQL。
<form action="" method="post">
<div class="container-fluid">
<div class="row">
<div class="col-lg-6" class = "text-center">
<h2>Responsibility Day!!</h2>
<table class="table table-striped" id="tab">
<thead>
<tr>
<th>Name</th>
<th>Task</th>
<th></th>
</tr>
</thead>
<tbod>
<% for(var i=0; i<persons.length; i++){ %>
<tr>
<td><%= persons[i].name %></td>
<td><%= persons[i].task %></td>
<td ><a href="/tasklist/<%= persons[i].name%>/<%= persons[i].task%>"><button class="glyphicon glyphicon-remove" ></button></a></td>
</tr>
<% } %>
<tr>
<td><input type="text" name="name"></td>
<td><input type="text" name="task"></td>
</tr>
</tbod>
</table>
</div>
</div>
<button class="btn btn-primary" id="addToList" type="submit">Submit</button>
</div>
</form>