JSP 如何在按下删除按钮后将其禁用?

sf6xfgos  于 2022-12-07  发布在  其他
关注(0)|答案(1)|浏览(159)

我有一个小表,里面有删除按钮的代码。当我点击删除按钮时,该行中的所有删除按钮都被禁用。我只想根据表中相应的值禁用一个按钮。其余的按钮应该保持启用状态。

<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>
vsnjm48y

vsnjm48y1#

当你点击按钮时,你可能会在函数作用域内得到一个事件e。

相关问题