PageSourceSearch

http://021ups.net/statics/Ajax/Forms/Validate.js?v=20210227150701

js 021ups.net collected 2026-10-09 04:32:55 UTC 9,924 bytes, 216 lines download raw bytes

1var this_url = .href;
2var regemail = /^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
3var regtelphone = /((\d{11})|^((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1}))$)/;
4var regnum = /^\d+$/;
5var regPcode = /^\d{6}$/;
6var regUrl = /^(http|http):\/\/(.+?)\.(.+)/;
7var regEx = /^[0-9]+$/gi;
8
9function getValue(obj) {
10    return $.trim($(obj).val());
11}
12
13function IsNum(obj, obj2) {
14    if (!regnum.test($(obj).val())) {
15        $(obj).val(obj2);
16    }
17}
18
19$(function () {
20    $('.isNum').keyup(function () {
21        IsNum(this, 1);
22    });
23});
24
25var required = function () {
26    var goon = true;//是否继续循环
27    var IsRunReg = false;//是否执行正在验证
28    $('.get:visible').map(function () {
29        if (goon) {
30            IsRunReg = false;
31            var val = getValue($(this));
32            var placeholder = $(this).attr('placeholder');
33            if ($(this).hasClass('required')) {
34                if (val.length == 0 || $(this).val() == placeholder) {
35                    if (placeholder != '' && placeholder != undefined) {
36                        layer.msg(placeholder);
37                    } else {
38                        layer.msg('请输入必填信息!');
39                    }
40                    if($(this).attr('name') != 'text4'){
41                        $(this).focus();
42                    }
43                    goon = false;
44                } else if (val.length == 1 && val == "0") {
45                    var placeholder = $(this).attr('placeholder');
46                    if (placeholder != '') {
47                        layer.msg(placeholder);
48                    } else {
49                        layer.msg('请输入必填信息!');
50                    }
51                    $(this).focus();
52                    goon = false;
53                }
54                IsRunReg = true;
55            }
56            if (!goon) {
57                return false;
58            }
59            if (!IsRunReg) {
60                if (val != undefined && val.length > 0 && val != placeholder) {
61                    IsRunReg = true;
62                }
63            }
64            if ($(this).hasClass('tel')) {
65                if (IsRunReg&&!regtelphone.test($(this).val())) {
66                    layer.msg('您输入电话的格式错误!');
67                    $(this).focus();
68                    goon = false;
69                }
70            } else if ($(this).hasClass('email')) {
71                if (IsRunReg && !regemail.test($(this).val())) {
72                    layer.msg('您输入邮箱的格式错误!');
73                    $(this).focus();
74                    goon = false;
75                }
76            } else if ($(this).hasClass('idcard')) {
77                if (IsRunReg && cardValid($(this).val())!='0') {
78                    layer.msg('您输入的身份证号码不正确!');
79                    $(this).focus();
80                    goon = false;
81                }
82            } else if ($(this).hasClass('postalcode')) {
83                if (IsRunReg && !regPcode.test($(this).val())) {
84                    layer.msg('您输入的邮政编码格式不正确!');
85                    $(this).focus();
86                    goon = false;
87                }
88            }else if ($(this).hasClass('qqnumber')) {
89                if (IsRunReg && !regEx.test($(this).val())) {
90                    layer.msg('请输入数字!');
91                    $(this).focus();
92                    goon = false;
93                }
94            } else if ($(this).hasClass('number')) {
95                if (IsRunReg && !regnum.test($(this).val())) {
96                    layer.msg('您输入的不是正整数!');
97                    $(this).focus();
98                    goon = false;
99                }
100                if (IsRunReg && $(this).attr('min')) {
101                    if (Number($(this).val().length) < Number($(this).attr('min'))) {
102                        layer.msg('您输入的值过小!');
103                        $(this).focus();
104                        goon = false;
105                    }
106                }
107                if (IsRunReg && $(this).attr('max')) {
108                    if (Number($(this).val().length) > Number($(this).attr('max'))) {
109                        layer.msg('您输入的值过大!');
110                        $(this).focus();
111                        goon = false;
112                    }
113                }
114            } else if ($(this).hasClass('weburl')) {
115                if (IsRunReg && !regUrl.test($(this).val())) {
116                    layer.msg('您输入的网址格式不正确!');
117                    $(this).focus();
118                    goon = false;
119                }
120            }
121        }
122    });
123    return goon;
124}
125eval(function (p, a, c, k, e, r) { e = function (c) { return (c < 62 ? '' : e(parseInt(c / 62))) + ((c = c % 62) > 35 ? String.fromCharCode(c + 29) : c.toString(36)) }; if ('0'.replace(0, e) == 0) { while (c--) r[e(c)] = k[c]; k = [function (e) { return r[e] || e }]; e = function () { return '[579bcefhjl-wyzA-F]' }; c = 1 }; while (c--) if (k[c]) p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]); return p }('function cardValid(s){7 t={11:"北京",12:"天津",13:"河北",14:"山西",15:"内蒙古",21:"辽宁",22:"吉林",23:"黑龙江",31:"上海",32:"江苏",33:"浙江",34:"安徽",35:"福建",36:"江西",37:"山东",41:"河南",42:"湖北",43:"湖南",44:"广东",45:"广西",46:"海南",50:"重庆",51:"四川",52:"贵州",53:"云南",54:"西藏",61:"陕西",62:"甘肃",63:"青海",64:"宁夏",65:"新疆",71:"台湾",81:"香港",82:"澳门",91:"国外"};7 l=0;7 5=s;7 u=5.v;9(!/^\\d{17}(\\d|x)$/i.w(5)&&!/^\\d{15}$/i.w(5)){b 1}9(t[y(5.c(0,2))]==null){b 2}9(u==15){e="19"+5.c(6,2)+"-"+h(5.c(8,2))+"-"+h(5.c(10,2));7 d=f m(e.n(/-/g,"/"));7 z=d.o().toString()+"-"+(d.A()+1)+"-"+d.B();9(e!=z){b 3}5=5.p(0,6)+"19"+5.p(6,15);5=5+GetVerifyBit(5)}7 C=f m();7 q=C.o();7 D=q-150;7 r=5.p(6,10);9(r<D||r>q){b 3}5=5.n(/x$/i,"a");e=5.c(6,4)+"-"+h(5.c(10,2))+"-"+h(5.c(12,2));7 d=f m(e.n(/-/g,"/"));9(e!=(d.o()+"-"+(d.A()+1)+"-"+d.B())){b 3}E(7 i=17;i>=0;i--){l+=(Math.pow(2,i)%11)*y(5.charAt(17-i),11)}9(l%11!=1){b 1}7 j=f F();j=f F("11111119111111111","12121219121212121","123456789087654321");E(7 k=0;k<j.v;k++){9(5.indexOf(j[k])!=-1){b 1}}b 0}', [], 42, '|||||strIDno||var||if||return|substr||sBirthday|new||Number||words||iSum|Date|replace|getFullYear|substring|nowYear|year|cardID|aCity|idCardLength|length|test||parseInt|dd|getMonth|getDate|nowDate|oldYear|for|Array'.split('|'), 0, {}));
126// 附件上传成功回调
127/*var uploadsuccess = function(newpath, area) {
128    $(area + " .ViewSpan").html("<a class='view'  href='" + "/" + newpath + "'>查看</a> <a href=\"javascript:void(0);\" class='again' onclick='re_upload_file(\"" + area + "\")' >重新上传</a>");
129    $(area + " #UploadFrame").hide();
130$(area + " .FileName").val("/" + newpath);
131$(area + " input[name=file]").val("/"+newpath);
132$(area + " div.viewbox").text("/" + newpath);
133};
134function re_upload_file(area) {
135    $(area + " #UploadFrame").attr("src", "/Plugin/FileManage/uploadImg.php?islarge=upload_1").show();
136$(area + " .ViewSpan").html("");
137$(area + " input[name=file]").val("");
138$(area + " div.viewbox").text("");
139}*/
140$(function () {
141    $('#btnSubmit').click(function () {
142        /*如果顺利获得表单验证*/
143        if (required()) {
144            //var attrArgs = new Array();/*参数名称集合*/
145            //var valArgs = new Array();/*参数值集合*/
146            /*$('.get:visible').map(function (i) {
147                if (getValue($(this)).length != 0) {
148                    attrArgs[i] = $(this).attr('name');
149                    valArgs[i] = escape(getValue($(this)));
150                }
151            });*/
152			var attrArgs = "";
153			var valArgs = "";
154			$('.get:visible').map(function(i) {
155				if (getValue($(this)).length != 0) {
156					attrArgs += $(this).attr('name') + ",";
157					valArgs += escape(getValue($(this))) + ","
158				} else {
159					attrArgs += $(this).attr('name') + ",";
160					valArgs += escape("") + ","
161				}
162			});
163			
164            var data = "attrArgs=" + encryption(attrArgs) + "&valArgs=" + encryption(valArgs) + "";
165            //disabled="disabled"
166            $("#btnSubmit").attr('disabled', true).css('background',"#333");
167            ajaxhelpForm(data, function (msg) {
168                var obj = eval('(' + msg + ')');
169                layer.msg(unescape(obj.info));
170                if (unescape(obj.status) == 1) {
171                    //埋点  点击事件
172                   // _paq.push(['trackEvent', '点击', $(this).attr("data-title"), '表单数据提交']);
173                     = this_url;
174                } else {
175                    $("#btnSubmit").removeAttr("disabled").css('background', "");
176                }
177            });
178        }
179    });
180});
181function ajaxhelpForm(data, fn) {
182        $.ajax({
183            "type": "post",
184            "url": "/index.php?m=Forms&a=ValidateHandler",
185            "data": data,
186            "datatype": "html",
187            "success": function (msg) {
188                if (fn) {
189                    fn(msg);
190                }
191            },
192            "error": function () {
193                /*layer.msg("对不起,服务器繁忙请稍后重试");*/
194            }
195        });
196    }
197function onbtnSubmit(formid){
198    $('#myform').form('submit', {
199        url:"/index.php?m=Forms&a=ValidateHandler",   
200        onSubmit: function(){   
201            return required();
202            return $(this).form('validate');
203        },
204        success:function(data){
205            var data = eval('(' + data + ')');
206            layer.msg(data.info);
207            if (data.status==1) {
208                 = this_url;
209            }
210        }
211    });
212}
213
214function changeCode(){
215	document.getElementById('forget_code_img').src='/api.php?m=Checkcode&code_len=4&font_size=34&width=200&height=80&font_color=&background=&time='+Math.random();
216}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.