-- 作者:洮沙
-- 发布时间:2021/12/3 8:00:00
-- [求助]按钮倒计时功能
老师,
.AddVcodeButton("hqyzm","获取验证码",2).Attribute="" \'按钮
wui.AppendHTML("<script src=\'./lib/yzm.js\'></script>") \'引用js文件
JS文件代码:
// JScript source code function sendcode() { var result = submitAjaxFileds(\'yzm.htm\', \'\', \'yh\', \'mm\', false); if (result == "OK") { cnt = 60; cnt = cnt - 1; if (cnt === 0) { } else { setTimeout(countDown, 1000); } showDialog(\'dlg1\', \'提示\', "邮件验证码已发送,请注意查收!"); } else { showDialog(\'dlg1\', \'出错\', result); } } function countDown() { cnt = cnt - 1; var bt1 = document.getElementById(\'hqyzm\'); if (cnt === 0) { bt1.disabled = false; bt1.innerHTML = "获取验证码"; } else { bt1.disabled = true; bt1.innerHTML = "获取(" + cnt + "秒)"
bt1.style.backgroundColor = "#999999"; bt1.style.Color = "#ffffff"; setTimeout(countDown, 1000); } }
计划当result == "OK"时执行倒计时函数,倒计时可以执行,按钮还是可以点击,无法禁用,背景颜色合适、字体颜色不起作用,又不懂了。麻烦老师指点指点。谢谢!
[此贴子已经被作者于2021/12/3 8:49:51编辑过]
|