<!--#INCLUDE FILE="validate.asp" -->

<%Function chkinput()

	If chkpost=False Then
		ErrMsg=ErrMsg+"<Br>"+"<li>您提交的数据不合法，请不要从校友录外部提交信息。"
		Call Error("Critical",ErrMsg)
		chkinput=False
		Exit Function
	End If

	name=Trim(Request.form("name"))

	If name="" Then
		ErrMsg=ErrMsg+"<br>"+"<li>请输入同学姓名"
		founderr=True
	ElseIf strlength(name)<4 or strlength(name)>8 Then
		ErrMsg=ErrMsg+"<br>"+"<li>同学姓名输入有误"
		founderr=True
	ElseIf not isChinese(name) Then
		ErrMsg=ErrMsg+"<br>"+"<li>同学姓名应为汉字"
		founderr=True
	End If

	If founderr=True Then
		Call Error("Information",ErrMsg)
		chkinput=False
		Exit Function
	End If

	telephone=Trim(Request("telephone"))
	mobilephone=Trim(Request("mobilephone"))
	address=rtrim(Request("address"))

	If telephone="" and mobilephone="" and address="" Then
		ErrMsg=ErrMsg+"<br>"+"<li>对不起，您至少应留下一种与该同学联系的通信方式!"
		founderr=True
	End If


	If telephone<>"" and not IsValidTel(telephone) Then
		ErrMsg=ErrMsg+"<br>"+"<li>电话号码输入错误"
		founderr=True
	End If

	if mobilephone<>"" and (len(mobilephone)<>11 or not isinteger(mobilephone) or left(mobilephone,2)<>"13") then
		errmsg=errmsg+"<br>"+"<li>移动电话输入错误"
		founderr=true
	end If

	zipcode=Trim(Request("zipcode"))

	If address="" and zipcode<>"" Then
		ErrMsg=ErrMsg+"<br>"+"<li>请输入通讯地址"
		founderr=True
	End If


	If zipcode<>"" and (len(zipcode)<>6 or not isinteger(zipcode)) Then
		ErrMsg=ErrMsg+"<br>"+"<li>邮政编码输入错误"
		founderr=True
	End If


	If strlength(address)>100 Then
		ErrMsg=ErrMsg+"<br>"+"<li>通讯地址不能超过100个字符！"
		founderr=True
	End If


	other=rtrim(Request("other"))
	If strlength(other)>255 Then
		ErrMsg=ErrMsg+"<br>"+"<li>其他信息不能超过255个字符！"
		founderr=True
	End If


	If founderr=True Then
		Call Error("Information",ErrMsg)
		chkinput=False
	Else
		chkinput=True
	End If

End Function
%>