我有一个用户表,每行有Info
,Edit
和Delete
按钮。在JSP页面上使用Bootstrap模式
<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>
当我点击删除按钮,该客户立即删除没有任何构象。我想使用Bootstrap模式进行确认是和否选项。你会看到每个Delete
按钮都被<form:form action="/deleteCustomer"...>
标记包围。有没有什么方法可以添加Bootstrap确认模式,同时保持这种结构,而不是在我的代码中添加任何Ajax调用?
为了当您正在等待来自用户的输入停止执行流程,你必须改变你的逻辑。 Bootstrap Modal不会停止要执行的“操作”,直到它被输入。 – VPK
您正在使用哪种Bootstrap版本? – VPK
Bootstrap v3.3.7 – Yonetmen