开发者

Using JS Event handlers inside a wizard inside an updatepanel

I've got a textbox being used to enter a password inside a wizard control. I'm trying to get a password strength meter working with it.

Unfortunately, the password box isn't visible until step 4 and this means that I can't开发者_JS百科 register the event handler onload() and putting some JS next to the PW box to register the event handler doesn't seem to fire. I'm guessing this is due to the contents of the wizard being loaded through an AJAX postback

Can someone please suggest how I can register the event handler? many thanks...

    function CheckCustomJSHandlers() {
        if (document.getElementById('<%=Password1.ClientID %>')) {
            document.getElementById('<%=Password1.ClientID %>').onkeyup = CheckPasswordStrength;
        }
    }


Add this to your JavaScript:

Sys.WebForms.PageRequestManager.getInstance().add_endRequest(CheckCustomJSHandlers);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜