各位大哥请用代码砸我把

解决方案 »

  1.   

    正则表达式 "w+([-+.]w+)*@w+([-.]w+)*.w+([-.]w+)*"
      

  2.   

    一般都是先用javascript做前台判断,前台判断为
    <script language="JavaScript">
    <!--
    function chk(theform)
    {
     if(theform.email.value.length!=0)
      {
        if (theform.email.value.charAt(0)=="." ||        
            theform.email.value.charAt(0)=="@"||       
             theform.email.value.indexOf('@', 0) == -1 || 
             theform.email.value.indexOf('.', 0) == -1 || 
             theform.email.value.lastIndexOf("@")==theform.email.value.length-1 || 
             theform.email.value.lastIndexOf(".")==theform.email.value.length-1)
         {
          alert("Email地址格式不正确!");
          theform.email.focus();
          return false;
          }
       }
     else
      {
       alert("Email不能为空!");
       theform.email.focus();
       return false;
       }}
    //-->
    </script>