﻿function check()
{
	if(document.login.txtName.value=="")
	{
		alert("对不起姓名不能为空！");
		document.login.txtName.focus();
		return false;
	}
	
	if(document.getElementById("sex_male").checked==false && document.getElementById("sex_male").checked==false)
	{
		alert("请选择性别!");
		return false;
	}
	
	if(document.login.txtAge.value=="")
	{
		alert("对不起年龄不能为空！");
		document.login.txtAge.focus();
		return false;
	}
	else if(!(/^\d+$/g).test(document.login.txtAge.value))
	{
		alert("年龄输入错误！\n\n注意：年龄必须为英文数字。");
		document.login.txtAge.focus();
		return false;
	}
	
	if(document.login.txtPhone.value=="")
	{
		alert("电话号码不能为空！");
		document.login.txtPhone.focus();
		return false;
	}
	
	if(document.login.txtAddress.value=="")
	{
		alert("地址不能为空！");
		document.login.txtAddress.focus();
		return false;
	}	
	
	if(document.login.txtSubject.value=="")
	{
		alert("主题不能为空！");
		document.login.txtSubject.focus();
		return false;
	}	

	if(document.login.txtContent.value=="")
	{
		alert("内容不能为空！");
		document.login.txtContent.focus();
		return false;
	}	
	
	if(document.login.vaildCode.value=="")
	{
		alert("验证码不能为空!");
		return false;	
	}
	
	return true;
}