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);
精彩评论