<script type="text/javascript">
<!--
function checkusername()
{
var reg=/^[0-9a-zA-Z_]/w{2,14}$/
if (!reg.test(document.register.username.value))
{
attach1.style.display = '';
}
else
{
attach1.style.display = 'none';
}
}
function checkpswd()
{
var reg=/^[0-9a-zA-Z]/w{5,19}$/
if (!reg.test(document.register.pswd.value))
{
attach2.style.display = '';
}
else
{
attach2.style.display = 'none';
}
}
function checkrepswd()
{
if (document.register.repswd.value==document.register.pswd.value)
{
attach3.style.display = 'none';
}
else
{
attach3.style.display = '';
}
}
function checkemail()
{
var reg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((/.[a-zA-Z0-9_-]{2,3}){1,2})$/;
if(document.register.email.value.length<6||!reg.test(document.register.email.value)||document.register.email.value.length>30)
{
attach4.style.display = '';
}
else
{
attach4.style.display = 'none';
}
}
function checkrealname()
{
var reg=/^[/u4e00-/u9fa5](/s*[/u4e00-/u9fa5])*$/;
if(document.register.realname.value.length<2||!reg.test(document.register.realname.value)||document.register.realname.value.length>4)
{
attach5.style.display = '';
}
else
{
attach5.style.display = 'none';
}
}
function checkqq()
{
var reg =/^[1-9]/d{4,8}$/;
if(!reg.test(document.register.qq.value))
{
attach6.style.display = '';
}
else
{
attach6.style.display = 'none';
}
}
function checktele()
{
reg =/^[1-9]/d*$/
if(document.register.tele.value.length<7||!reg.test(document.register.tele.value)||document.register.tele.value.length>11)
{
attach7.style.display = '';
}
else
{
attach7.style.display = 'none';
}
}
function checkmobile()
{
var reg = /^((/(/d{2,3}/))|(/d{3}/-))?13/d{9}$/;
if(document.register.mobile.value.length>0&&(document.register.mobile.value.length<11||!reg.test(document.register.mobile.value)||document.register.mobile.value.length>12))
{
attach8.style.display = '';
}
else
{
attach8.style.display = 'none';
}
}
function checkhomepage()
{
var reg = /^http:[A-Za-z0-9]+/.[A-Za-z0-9]+[//=/?%/-&_~`@[/]/':+!]*([^<>/"/"])*$/;
if(document.register.homepage.value.length>7&&(!reg.test(document.register.homepage.value)||document.register.homepage.value.length>50))
{
attach9.style.display = '';
}
else
{
attach9.style.display = 'none';
}
}
function checkintroduction()
{
if(document.register.introduction.value.length<10||document.register.introduction.value.length>250)
{
attach10.style.display = '';
}
else
{
attach10.style.display = 'none';
}
}
function checkinterest()
{
if(document.register.interest.value.length<10||document.register.interest.value.length>250)
{
attach11.style.display = '';
}
else
{
attach11.style.display = 'none';
}
}
function checkforum_id()
{
if(document.register.forum_id.value.length>0&&(document.register.forum_id.value.length<3||document.register.forum_id.value.length>12))
{
attach12.style.display = '';
}
else
{
attach12.style.display = 'none';
}
}
function checkpswd2()
{
var reg=/^[0-9a-zA-Z]/w{5,19}$/;
if (!reg.test(document.quotepswd.newpswd.value))
{
attach13.style.display = '';
}
else
{
attach13.style.display = 'none';
}
}
function checkpswd3()
{
if (document.quotepswd.newpswd.value!=document.quotepswd.renewpswd.value)
{
attach14.style.display = '';
}
else
{
attach14.style.display = 'none';
}
}
function checkcollege()
{
if (document.register.college.value=='')
{
attach16.style.display = '';
}
else
{
attach16.style.display = 'none';
}
}
function checkcode1()
{
if (document.register.checkcode.value.length<5)
{
attach15.style.display = '';
}
else
{
attach15.style.display = 'none';
}
}
function checkmajor()
{
if (document.register.major.value=='')
{
attach17.style.display = '';
}
else
{
attach17.style.display = 'none';
}
}
function InitAjax()
{
var ajax=false;
try {
ajax = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
ajax = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
ajax = false;
}
}
if (!ajax && typeof XMLHttpRequest!='undefined') {
ajax = new XMLHttpRequest();
}
return ajax;
}
function isusername()
{
//获取接受返回信息层
var msg = document.getElementById("msg");
//获取表单对象和用户信息值
var f = document.user_info;
var userName = register.username.value;
//接收表单的URL地址
var url = "test.php";
//需要POST的值,把每个变量都通过&来联接
var postStr = "user_name="+ userName;
//实例化Ajax
var ajax = InitAjax();
//通过Post方式打开连接
ajax.open("POST", url, true);
//定义传输的文件HTTP头信息
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
//发送POST数据
ajax.send(postStr);
//获取执行状态
ajax.onreadystatechange = function() {
//如果执行状态成功,那么就把返回信息写到指定的层里
if (ajax.readyState == 4 && ajax.status == 200) {
msg.innerHTML = ajax.responseText;
}
}
}
function isforum_id()
{
//获取接受返回信息层
var msg = document.getElementById("msg1");
//获取表单对象和用户信息值
var f = document.user_info;
var forum_id = register.forum_id.value;
//接收表单的URL地址
var url = "/forum/test.php?action=test&forum_id="+ forum_id;
//需要POST的值,把每个变量都通过&来联接
var postStr ="";
//实例化Ajax
var ajax = InitAjax();
//通过Post方式打开连接
ajax.open("POST", url, true);
//定义传输的文件HTTP头信息
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
//发送POST数据
ajax.send(postStr);
//获取执行状态
ajax.onreadystatechange = function() {
//如果执行状态成功,那么就把返回信息写到指定的层里
if (ajax.readyState == 4 && ajax.status == 200) {
msg.innerHTML =ajax.responseText;
}
}
}
-->
</script>