﻿// JScript 文件

function check_back_01()
  {
        var content=document.getElementById("TextBox2");
        var username=document.getElementById("TextBox1");
        var regx=/([\w]*)+[@]{1}([\w]*)+[.]{1}([\w]*)+/;
        
         if(username.value=="" || Alltrim(username.value)=="" )
         {
            alert("请输入用户名!");
            return false;
         }
           if(content.value=="" || Alltrim(content.value)=="" )
         {
            alert("请输入E-mail!");
            return false;
         }
         if(!regx.test(content.value))
         {
            alert("E-mail格式不正确!");
            return false; 
         }
         return true;
}
        
        
 //不能为空
    function Alltrim(str) 
    { 
        while (str.charAt(0) == " " || str.charAt(0) == "　")
        {
            str = str.substr(1);
        }
        while (str.charAt(str.length - 1) == " " || str.charAt(0) == "　")
        {
            str = str.substr(0, str.length - 1);
        }
        return (str); 
    } 
