(function ($) {
var defaults = {
Bugcolor: ' #FFCCCC ',//When the data is wrong, text box color
Color: ' white ',//Data Right time text box colors
Type: "Alert",///When the data is wrong prompt way alert pop-up box text assignment span HTML
msg: "MSG",///When the data is wrong, prompt content
Resojid: ' No '//when the test method is assigned to the label #id
};
function uiprocess (options, rexstring, object) {
var options = $.extend (defaults, options);
var values = Object.val ();
if (Rexstring.test (values)) {
Object.css ("BackgroundColor", Options.color);
return true;
} else {
Object.css ("BackgroundColor", Options.bugcolor);
if (Options.type = = "alert") {
alert (options.msg);
}
if (Options.type = = "Text") {
$ (options.) Resojid). HTML (OPTIONS.MSG);
}
return false;
}
}
Verify that the IP conforms to the format
$.fn. REGIP = function (options) {
var rexstring =/^\d{1,3}\. {1}\d{1,3}\. {1}\d{1,3}/;
Return uiprocess (Options, rexstring, this)
}
Verify that the landline is in line with the format
$.fn. Regtelphone = function (options) {
var rexstring =/^[0-9]+[-]? [0-9]+[-]? [0-9]$/;
Return uiprocess (Options, rexstring, this)
}
Verify that the phone matches the format
$.fn. Regmombilephone = function (options) {
var rexstring =/(^189\d{8}$) | (^13\d{9}$) | (^15\d{9}$)/;
Return uiprocess (Options, rexstring, this)
}
Verify Chinese is in line with format
$.fn. REGCHZN = function (options) {
var rexstring =/[\u4e00-\u9fa5]/;
Return uiprocess (Options, rexstring, this)
}
Verify that decimal matches the format
$.fn. Regdecimal = function (options) {
var rexstring =/^[0-9]+[.]? [0-9]+$/;
Return uiprocess (Options, rexstring, this)
}
Verify that decimal keeps a decimal number in the format
$.fn. Regdecimalsign = function (options) {
var rexstring =/^[+-]? [0-9]+[.]? [0-9]+$/;
Return uiprocess (Options, rexstring, this)
}
Verify that the integer retains a decimal number in the format
$.fn. Regnumber = function (options) {
var rexstring =/^[0-9]+$/;
Return uiprocess (Options, rexstring, this)
}
Verify that the integers keep a decimal number in the format
$.fn. Regnumbersign = function (options) {
var rexstring =/^[+-]? [0-9]+$/;
Return uiprocess (Options, rexstring, this)
}
Verifying non-null characters
$.fn. IsEmpty = function (options) {
var rexstring =/(^.+$) | ([\U4E00-\U9FA5])/;
Return uiprocess (Options, rexstring, this)
}
}) (JQuery);