私は、各行にInfo
,Edit
およびDelete
のボタンを持つusersテーブルを持っています。JSPページでブートストラップ・モーダルを使用する
<tbody>
<c:choose>
<c:when test="${not empty customers}">
<c:forEach items="${customers}" var="customer">
<tr>
<td><c:out value="${customer.id}" /></td>
<td><c:out value="${customer.name}"/></td>
<td><c:out value="${customer.phoneNumber}"/></td>
<td><c:out value="${customer.email}"/></td>
<td style="text-align: center">
<form:form action="/customerDetails"><input type="hidden" name="email" value="${customer.email}"/>
<button class="btn btn-warning btn-xs"><span class="glyphicon glyphicon-list-alt"></span></button>
</form:form>
</td>
<td style="text-align: center">
<form:form action="/findCustomer"><input type="hidden" name="email" value="${customer.email}"/>
<button class="btn btn-primary btn-xs"><span class="glyphicon glyphicon-pencil"></span></button>
</form:form>
</td>
<td style="text-align: center">
<form:form action="/deleteCustomer"><input type="hidden" name="email" value="${customer.email}"/>
<button class="btn btn-danger btn-xs"><span class="glyphicon glyphicon-trash"></span></button>
</form:form>
</td>
</tr>
</c:forEach>
</c:when>
<c:otherwise>
<h2>There is no registered customers</h2>
</c:otherwise>
</c:choose>
</tbody>
私が[削除]ボタンをクリックすると、その顧客はコンフォメーションなしで直ちに削除されます。私ははいといいえオプションで確認のためにブートストラップモードを使用したいと思います。各Delete
ボタンが<form:form action="/deleteCustomer"...>
タグで囲まれていることがわかります。この構造を維持しながら、コード内にAjax呼び出しを追加しないで、ブートストラップ確認モーダルを追加する方法はありますか?
は、ユーザーからの入力を待っている間に実行フローを停止するためには、あなたのロジックを変更する必要があります。 Bootstrap Modalは、入力が得られるまで実行される 'action'を停止しません。 – VPK
あなたはどちらのブートストラップバージョンを使用していますか? – VPK
Bootstrap v3.3.7 – Yonetmen