views:

42

answers:

1

Hi All,

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 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;
        }
    }
+1  A: 

Add this to your JavaScript:

Sys.WebForms.PageRequestManager.getInstance().add_endRequest(CheckCustomJSHandlers);
zincorp
Worked like a charm, many thanks :)
Basiclife