Wednesday, December 7, 2016

Chechbox checked change event in Updatepanel




var prm = Sys.WebForms.PageRequestManager.getInstance();
    if (prm != null) {
        prm.add_endRequest(function (sender, e) {
            if (sender._postBackSettings.panelsToUpdate != null) {
                callx();
            }
        });
    };

    function callx() {
        $("#<%=chkSaveOnDocLib.ClientID%>").change(function () {
            if (this.checked) {                
                var dt = new Date();
                var time = dt.getHours() + dt.getMinutes() + dt.getSeconds();
               
                document.getElementById("txtFileName").value = document.getElementById("hdnCurrentUser").value + time;
            }
            else {
                document.getElementById("txtFileName").value = "";
            }
        });

    }

No comments:

Post a Comment