本文介绍了如何处理Pop_Up窗口“X”按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,非常早安..
我在处理Unbeforeload时遇到了一个小问题。
我的问题:基于一些计数我需要显示一个弹出窗口,如果计数等于,我需要取消弹出窗口。
我可以在Pop_Up窗口中处理按钮。如果用户点击它,是否可以显示任何错误消息?
要求:如果用户点击按钮(右上角),它应该像取消按钮一样。截至目前,它正在提交像按钮
示例JS代码:
Hi All, Very Good Morning..
I got a small problem when handling the Unbeforeload.
My Problem: Based on Some count i need to show a pop-up window and if the count equals, I need to cancel the pop-Up.
Can i handle button in Pop_Up window. If the user clicks on it, is it possible to show any error Message?
Requirement: If the user clicks on button (Top-Right Corner) in Pop_up Window, it should act like Cancel button. As of now, it is submitting like button
Sample JS Code:
window.onbeforeunload = function () {
window.returnValue = document.getElementById("hidAttachedCount").value;
if (window.returnValue == "3") {
CausesValidation = "false";
}
else {
return "Did you save your stuff?";
}
}
推荐答案
这篇关于如何处理Pop_Up窗口“X”按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!