﻿function CheckInput(theForm)
{
    for(var i=0;i<theForm.elements.length;i++)
    {
        if(theForm.elements[i].getAttribute("IsMustFill") != null && theForm.elements[i].value.length==0)
       {
                alert("带*号的必须填写!");
                theForm.elements[i].focus();
                return false;
        }
        if(theForm.elements[i].getAttribute("IsNumber") != null && theForm.elements[i].value.length!=0)
        {
            if(InputNum(theForm.elements[i])==false)
            {
                    alert("请填写正确的数字!");
                    theForm.elements[i].focus();
                    return false;
                
            }
        }
        if(theForm.elements[i].getAttribute("IsEmail") != null && theForm.elements[i].value.length!=0)
        {
            if(CheckEmail(theForm.elements[i].value)==false)
            {
                    alert("请填写正确的电子邮箱!");
                    theForm.elements[i].focus();
                    return false;
                
            }
        }
    }
}
