验证码处理

2019-04-15 15:45发布

function loadImage()
{
 document.getElementById("verifycodeimage").src = "verifyCodePage.action?pic="+Math.random();
} function checkVerifyCode()
{
    var s = document.getElementsByName("loginBean.usercheck")[0];
    var e = s.value;
    if(e==null||e.length!=4)
    {
        return false;
    }
    var re = new RegExp("[0-9]+");
    var r = e.match(re);
    if(null == r|| e!=r)
    {
        return false;
    }
    return true;
}
function alertVerifyCode()
{
    var flag=checkVerifyCode();
    if(!flag)
    {
        alert('');
    }
}                title="        key='mvas.login.verifycode.img' />"
             src="verifyCodePage.action" width="53" height="21"
             align="top" onclick="loadImage();" id="verifycodeimage" />