• 逐浪CMS对用户注册字段正则的自由定义(注册字段必填)


    在逐浪CMS中,经常会遇到自由字段增加功能。这也是逐浪CMS的强大特色,比如注册页加字段:
    在这里插入图片描述

    如果加了这段,如何定义其正则呢?

    其实很简单,只要编辑AreasUserViewsIndexRegister.cshtml文件
    加上你的字段正则就行,如下:

            validate.zl_init($("form"), {
                rules: {
                    TxtUserName: { required: true },
                    TxtPassword: { required: true },
                    TxtPwdConfirm: { required: true, equalTo: "#TxtPassword" },
                    userType: { required: true },
                    userTypeTest: { required: true },
                    userTypeTwoTest: {exec:/[^_IOZSVa-zW]{2}d{6}[^_IOZSVa-zW]{10}/g},
            selcoutry: { required: true } /照此加字段
                },
                messages: {
                    TxtUserName: { required: "用户名不能为空" },
                    TxtPassword: { required: "密码不能为空" },
                    TxtPwdConfirm: { required: "确认密码不能为空", equalTo: "必须同于密码" },
                    userType: { required: "身份不能为空" },
                    userTypTest: { required: "身份内容不能为空" },
                    userTypeTwoTest: { exec: "统一社会信用代码格式错误" },
            selcoutry: { required: "省市县选择不能为空" } //照此加字段
                },
    

      

  • 相关阅读:
    Activemq+Zookeeper集群
    Centos7 安装 ActiveMQ 5.15.1
    189. Rotate Array
    188. Best Time to Buy and Sell Stock IV
    187. Repeated DNA Sequences
    186.Reverse Words in a String II
    179. Largest Number
    174. Dungeon Game
    173. Binary Search Tree Iterator
    172. Factorial Trailing Zeroes
  • 原文地址:https://www.cnblogs.com/fonts/p/13456340.html
Copyright © 2020-2023  润新知