﻿function FormCheck22()
{
		if (document.form2.username2.value == "")
        {alert("请输入称呼 ! ");
	     document.form2.username2.focus();
         return false;
        }
	 
		if (document.form2.email.value == "")
        {alert("请输入邮箱!  ");
	 document.form2.email.focus();
         return false;
        }
			if (document.form2.subject.value == "")
        {alert("请输入标题! ");
	 document.form2.subject.focus();
         return false;
        }
		if (document.form2.content.value == "")
        {alert("请输入内容! ");
	 document.form2.content.focus();
         return false;
        }
return true;
}
function checklogin()
{
	if(document.loginform.username.value=="")
	{
		alert("用户名不能为空");
		document.loginform.username.focus();
		document.loginform.username.select();
		return false;
   }
   if(document.loginform.password.value=="")
	{
		alert("密码不能为空");
		document.loginform.password.focus();
		document.loginform.password.select();
		return false;
   }
   return true;
}
function checkregform()
{
	if(document.regform.uid.value=="")
	{
		alert("用户名不能为空");
		document.regform.uid.focus();
		document.regform.uid.select();
		return false;
	}
	if(document.regform.pwd.value=="")
	{
		alert("密码不能为空");
		document.regform.pwd.focus();
		document.regform.pwd.select();
		return false;
	}
	if(document.regform.name.value=="")
	{
		alert("真实姓名不能为空");
		document.regform.name.focus();
		document.regform.name.select();
		return false;
	}
     /*单选框验证*/
	  /*var temp=document.getElementsByName("xz"); 
      for (i=0;i<temp.length;i++)
	  { 
        if(temp[i].checked) 
       {
        if(temp[i].value==2)
		{
			alert("公司名称不能为空");
		    document.regform.company.focus();
		    document.regform.company.select();
		    return false;
		}
       }
     }*/
	  var temp=document.getElementsByName("xz"); 
      for (i=0;i<temp.length;i++)
	  { 
	    if(temp[i].checked)
		{
       
        if(temp[i].value==2&&document.regform.company.value=="")
		{
			alert("公司名称不能为空");
		    document.regform.company.focus();
		    document.regform.company.select();
		    return false;
		}
	
	   }
     }
	 if(document.regform.address.value=="")
	{
		alert("地址不能为空");
		document.regform.address.focus();
		document.regform.address.select();
		return false;
	}
	if(document.regform.phone.value=="")
	{
		alert("电话不能为空");
		document.regform.phone.focus();
		document.regform.phone.select();
		return false;
	}
	if(document.regform.contact_man.value=="")
	{
		alert("联系人不能为空");
		document.regform.contact_man.focus();
		document.regform.contact_man.select();
		return false;
	}
 return true;
}

