我有一个小表,里面有删除按钮的代码。当我点击删除按钮时,该行中的所有删除按钮都被禁用。我只想根据表中相应的值禁用一个按钮。其余的按钮应该保持启用状态。
<c:when
test="${(****) == 1 && ****}">
<display:column title="Delete" class="cell-text-centered">
<i class="btn-link glyphicon glyphicon-trash"
onclick="fn_delete('<%=urlDelete%>')"></i>
</display:column>
</c:when>
<c:otherwise>
<display:column title="Delete" style="width:5%"
class="cell-text-centered">
<i class="glyphicon glyphicon-trash"></i>
</display:column>
</c:otherwise>
</c:choose>
<script>
function fn_delete(url) {
var deleteAnswer = confirm("Do you want to delete corresponding data?");
if (deleteAnswer == true) {
document.Form.action = url;
document.Form.submit();
}
}
</script>
1条答案
按热度按时间vsnjm48y1#
当你点击按钮时,你可能会在函数作用域内得到一个事件e。