如何处理Pop_Up窗口“X”按钮? [英] How to Handle Pop_Up Window "X" button ?

查看:129
本文介绍了如何处理Pop_Up窗口“X”按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,非常早安..



我在处理Unbeforeload时遇到了一个小问题。



我的问题:基于一些计数我需要显示一个弹出窗口,如果计数等于,我需要取消弹出窗口。



我可以在Pop_Up窗口中处理X按钮。如果用户点击它,是否可以显示任何错误消息?



要求:如果用户点击 Pop_up窗口中的X按钮(右上角),它应该像取消按钮一样。截至目前,它正在提交像OK按钮





示例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 "X" 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 "X" button (Top-Right Corner) in Pop_up Window, it should act like Cancel button. As of now, it is submitting like "OK" 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?";
        }
    }

推荐答案

http://mattberseth.com/blog/2007/10/modalpopup_with_multiple_cance.html [ ^ ]







参考此链接
http://mattberseth.com/blog/2007/10/modalpopup_with_multiple_cance.html[^]



refer this link


这篇关于如何处理Pop_Up窗口“X”按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆