﻿
var pAccountID = /^[a-zA-Z0-9_]{4,16}$/;
var pPassword = /^[a-zA-Z0-9]{6,18}$/;

function verifyInput()
{
    if(!verifyNullInput(document.getElementById("login_txtAccountID"),"通行证帐号不能为空"))
    {
        return false;
    }
        if(!verifyNullInput(document.getElementById("login_txtPassword"),"密码不能为空"))
    {
        return false;
    }
    if(!pAccountID.test(document.getElementById("login_txtAccountID").value))
    {
        alert("通行证帐号格式不正确");
        return false;
    }
        if(!pPassword.test(document.getElementById("login_txtPassword").value))
    {
        alert("密码格式不正确");
        return false;
    }
    return true;
    
}

function verifyNullInput(input,error)
{
    if(input.value=="") 
    {
        alert(error);
        return false;
    }
    return true;
}

