﻿function CheckForm()
{
  // == exhibit_name ======
  if (document.myform.exhibit_name.value=="")
  {
    alert("请填写展览名称！");
	document.myform.exhibit_name.focus();
	return false;
  }
  // == organization ======
  if(myform.organization.value=="")
  {
	  alert("请填写单位名称！");
	  myform.organization.focus();
	  return false;
  }
  // == contactman ======
  if(myform.contactman.value=="")
  {
	  alert("请填写联络人（提交人）姓名！");
	  myform.contactman.focus();
	  return false;
  }
  // == cellphone ======
  if(myform.cellphone.value=="")
  {
	  alert("请填写手机号码！");
	  myform.cellphone.focus();
	  return false;
  }
  else {
	  if(isNaN(document.myform.cellphone.value)) {
		  alert("手机号码格式错误！"); return false;
	  }
  }
  // == phone ======
  if (document.myform.phone_a.value==""||document.myform.phone_b.value==""||document.myform.phone_num.value=="")
  {
    alert("请填写电话号码！");
	document.myform.phone_b.focus();
	document.myform.phone_num.focus();
	return false;
  }
  else {
	  if(isNaN(document.myform.phone_num.value)||document.myform.phone_num.value>99999999||document.myform.phone_b.value>1000) {
		  alert("电话号码格式错误！"); return false; }
  }
  // == email ======
  if(myform.email.value=="")
  {
	  alert("电子邮件不能为空！");
	  myform.email.focus();
	  return false;
  }
  else
  {
	  reg=/^([a-zA-Z0-9]+[_|\-|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\-|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/gi;
	  if(!reg.test(myform.email.value))
	  {
		  alert("非法的电子邮件！");
		  myform.email.focus();
		  return false;
	  }
  }
  // == address ======
  if(myform.address.value=="")
  {
	  alert("请填写您的通讯地址！");
	  myform.address.focus();
	  return false;
  }
  // == e_time1 ======
  if(myform.e_time1.value=="")
  {
	  alert("预计办展时间不能为空！");
	  myform.e_time1.focus();
	  return false;
  }
  // == e_time1 ======
  if(myform.content.value=="")
  {
	  alert("请填写展览简介！");
	  myform.content.focus();
	  return false;
  }
  //
  return true;  
}
//// ======= Only Number =========
function isNum()
{
  return ((event.keyCode >= 48) && (event.keyCode <= 57));
}



