• 邮箱 手机号 验证


    //必选项背景色 手机号为必选项
    function invoicedt(){
    var areaSum = document.getElementById("phone_number").value;

    if(null!=areaSum || areaSum!=""){
    document.getElementById("phone_number").style.backgroundColor = "white";
    }
    if(null==areaSum || areaSum==""){
    //$.messager.alert('提示', "电话是必填项!");
    document.getElementById("phone_number").style.backgroundColor = "#fff3f3";
    }

    }
    //邮箱设置为必选项
    function invoicedtEimal(){
    var areaSum = document.getElementById("email_no").value;

    if(null!=areaSum || areaSum!=""){
    document.getElementById("email_no").style.backgroundColor = "white";
    }
    if(null==areaSum || areaSum==""){
    //$.messager.alert('提示', "电话是必填项!");
    document.getElementById("email_no").style.backgroundColor = "#fff3f3";
    }

    }

    //验证邮箱
    function emailLimit() {

    var Email = $("#email_no").val();
    if(null != Email && "" != Email){
    var ret = /^([a-z0-9A-Z]+[-_|.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?.)+[a-zA-Z]{2,}$/;
    if (!ret.test(Email)) {
    $.messager.alert("提示", "请输入格式正确的邮箱!", "info");
    $("#email_no").val("");
    }
    }
    }

    //验证邮箱 添加
    function checkemail() {
    var Email = $("#email_no").val();
    if(null != Email && "" != Email){
    var ret = /^([a-z0-9A-Z]+[-_|.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?.)+[a-zA-Z]{2,}$/;
    if (!ret.test(Email)) {
    $.messager.alert("提示", "请输入格式正确的邮箱!", "info");
    $("#email_no").val("");
    }
    }
    }

    //电话验证 添加
    function mblLimit() {
    var mblNo = $("#phone_number").val();
    if(null != mblNo && "" != mblNo){

    var ret = /^1(3[0-9]|4[57]|5[0-35-9]|7[0135678]|8[0-9]|9[0-9]])d{8}$/;
    if (!ret.test(mblNo)) {
    $.messager.alert("提示", "请输入格式正确的手机!", "info");
    $("#phone_number").val("");
    }
    }
    }

  • 相关阅读:
    Luogu P6623 [省选联考 2020 A 卷] 树|Trie
    Luogu P4683【IOI2008】Type Printer 打印机|trie
    Luogu P5658 括号树|搜索+递推
    Luogu P4514 上帝造题的七分钟|二维树状数组
    Luogu P1314 【NOIP2011】聪明的质检员|前缀和+二分
    Html5表单元素
    HTML5视频音频
    HTML5语义化标签
    斗地主案例
    Collection集合
  • 原文地址:https://www.cnblogs.com/xianz666/p/12124929.html
Copyright © 2020-2023  润新知