Twitter bootstrap 引导替代onclick=";return confirm(';是否确实要删除此记录?';)";
我使用带有编辑和删除按钮的引导类在表中显示数据库中的数据。在删除记录之前,我将使用默认javascript确认框显示-是否删除确认模式框-Twitter bootstrap 引导替代onclick=";return confirm(';是否确实要删除此记录?';)";,twitter-bootstrap,jsp,servlets,Twitter Bootstrap,Jsp,Servlets,我使用带有编辑和删除按钮的引导类在表中显示数据库中的数据。在删除记录之前,我将使用默认javascript确认框显示-是否删除确认模式框- onclick="return confirm('Are you sure you want to delete this Record ?')". 这可以正常工作并删除正确的记录&代码如下: <form method="POST" action="${pageContext.request.contextPath}/orgController"&g
onclick="return confirm('Are you sure you want to delete this Record ?')".
这可以正常工作并删除正确的记录&代码如下:
<form method="POST" action="${pageContext.request.contextPath}/orgController">
<td align="center"><button type="submit" name="delete" value=<c:out value="${orgList.orgId}"/> class="btn btn-warning btn-xs" onclick="return confirm('Are you sure you want to delete this Record ?')">Remove</button></td>
</form>
去除
我正在使用Java/JSP/Servlet来显示和处理请求
我要寻找的是某种使用引导模式类的精确替代品
我在互联网上找到了这段代码,通过在html标题部分使用以下javascript代码来确保数据正常工作,这段代码应该完全符合我的要求-
<script>
$(document).ready(function() {
$('a[data-confirm]').click(function(ev) {
var href = $(this).attr('href');
if (!$('#dataConfirmModal').length) {
$('body').append('<div id="dataConfirmModal" class="modal" role="dialog" aria-labelledby="dataConfirmLabel" aria-hidden="true"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button><h3 id="dataConfirmLabel">Please Confirm</h3></div><div class="modal-body"></div><div class="modal-footer"><button class="btn" data-dismiss="modal" aria-hidden="true">Cancel</button><a class="btn btn-primary" id="dataConfirmOK">OK</a></div></div>');
}
$('#dataConfirmModal').find('.modal-body').text($(this).attr('data-confirm'));
$('#dataConfirmOK').attr('href', href);
$('#dataConfirmModal').modal({show:true});
return false;
});
});
</script>
$(文档).ready(函数(){
$('a[数据确认])。单击(功能(ev){
var href=$(this.attr('href');
如果(!$('#dataConfirmModal')。长度){
$('body')。追加('x请确认取消OK');
}
$('#dataConfirmModal').find('.modal body').text($(this.attr('data-confirm'));
$('#dataConfirmOK').attr('href',href);
$('#dataConfirmModal').modal({show:true});
返回false;
});
});
并尝试在
去除
但是,这不是弹出模式窗口,而是删除右侧的表行
我们将非常感谢您提供的任何线索、指导或帮助
<form method="POST" action="${pageContext.request.contextPath}/organisationController">
<td align="center"><button type="submit" name="delete" value=<c:out value="${orgList.organisationId}"/> class="btn btn-warning btn-xs" data-confirm="Are you sure you want to delete this Record ? ">Remove</button></td>
</form>