zoukankan      html  css  js  c++  java
  • jquery验证邮箱

    jquery验证邮箱
    2010-12-08 17:28

    <%@ page language="java" import="java.util.*" pageEncoding="GBK"%>
    <%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
    %>

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
      <head>
        <base href="<%=basePath%>">
       
        <title>My JSP 'Email.jsp' starting page</title>
       
     <meta http-equiv="pragma" content="no-cache">
     <meta http-equiv="cache-control" content="no-cache">
     <meta http-equiv="expires" content="0">   
     <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
     <meta http-equiv="description" content="This is my page">
     <!--
     <link rel="stylesheet" type="text/css" href="styles.css">
     -->
    <script type="text/javascript" src="JavaScript/jquery-1.4.js"></script>
      </head>
     
      <body>
      <script>
      function check(){
     
       if($("#email1").val()==""){
      
        alert("邮箱不能为空");
        $("#tips").html("不能输入空的");
       return FALSE;
         
       }
       if(!$("#email1").val().match(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/)){
         alert("格式不正确!请重新输入");
         $("#email1").focus();
        
        
       }
      
        }
     
      </script>
      <form action="#">
      <input type="text" id="email1"><br><span id="tips"></span><br>
      <input type="button" value="提交" onclick="check()">
     
      </form>
     
     
     
      </body>
    </html>

  • 相关阅读:
    组合模式扩展,有选择的递归
    SQL分页查询【转】
    facade外观模式
    C#:几种数据库的大数据批量插入 faib
    装饰模式的扩展
    yeild之我理解
    数据库操作 sqlserver查询存储过程+分页
    SQL Server 索引结构及其使用(二)[转]
    SQL索引使用初步,(转)
    解决多集成,多子类,扩展等 装饰模式
  • 原文地址:https://www.cnblogs.com/hxwzwiy/p/2418591.html
Copyright © 2011-2022 走看看