在更新面板内的向导中使用 JS 事件处理程序
我有一个文本框用于在向导控件内输入密码。我正在尝试使用密码强度计来使用它。
不幸的是,密码框直到第 4 步才可见,这意味着我无法注册事件处理程序 onload() 并且在 PW 框旁边放置一些 JS 来注册事件处理程序似乎不会触发。我猜这是因为向导的内容是通过 AJAX 回发加载的。
有人可以建议我如何注册事件处理程序吗?非常感谢...
function CheckCustomJSHandlers() {
if (document.getElementById('<%=Password1.ClientID %>')) {
document.getElementById('<%=Password1.ClientID %>').onkeyup = CheckPasswordStrength;
}
}
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;
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将其添加到您的 JavaScript 中:
Add this to your JavaScript: