PageSourceSearch

https://navs-online.org/wp-content/plugins/wysija-newsletters/js/v…/languages/jquery.validationEngine-en.js

js navs-online.org collected 2026-10-02 04:05:38 UTC 11,400 bytes, 206 lines download raw bytes

1(function($){
2    $.fn.validationEngineLanguage = function(){
3    };
4    $.validationEngineLanguage = {
5        newLang: function(){
6            $.validationEngineLanguage.allRules = {
7                "required": { // Add your regex rules here, you can take telephone as an example
8                    "regex": "none",
9                    "alertText": "* This field is required",
10                    "alertTextCheckboxMultiple": "* Please select an option",
11                    "alertTextCheckboxe": "* This checkbox is required",
12                    "alertTextDateRange": "* Both date range fields are required"
13                },
14                "requiredInFunction": { 
15                    "func": function(field, rules, i, options){
16                        return (field.val() == "test") ? true : false;
17                    },
18                    "alertText": "* Field must equal test"
19                },
20                "dateRange": {
21                    "regex": "none",
22                    "alertText": "* Invalid ",
23                    "alertText2": "Date Range"
24                },
25                "dateTimeRange": {
26                    "regex": "none",
27                    "alertText": "* Invalid ",
28                    "alertText2": "Date Time Range"
29                },
30                "minSize": {
31                    "regex": "none",
32                    "alertText": "* Minimum ",
33                    "alertText2": " characters required"
34                },
35                "maxSize": {
36                    "regex": "none",
37                    "alertText": "* Maximum ",
38                    "alertText2": " characters allowed"
39                },
40		"groupRequired": {
41                    "regex": "none",
42                    "alertText": "* You must fill one of the following fields",
43                    "alertTextCheckboxMultiple": "* Please select an option",
44                    "alertTextCheckboxe": "* This checkbox is required"
45                },
46                "min": {
47                    "regex": "none",
48                    "alertText": "* Minimum value is "
49                },
50                "max": {
51                    "regex": "none",
52                    "alertText": "* Maximum value is "
53                },
54                "past": {
55                    "regex": "none",
56                    "alertText": "* Date prior to "
57                },
58                "future": {
59                    "regex": "none",
60                    "alertText": "* Date past "
61                },	
62                "maxCheckbox": {
63                    "regex": "none",
64                    "alertText": "* Maximum ",
65                    "alertText2": " options allowed"
66                },
67                "minCheckbox": {
68                    "regex": "none",
69                    "alertText": "* Please select ",
70                    "alertText2": " options"
71                },
72                "equals": {
73                    "regex": "none",
74                    "alertText": "* Fields do not match"
75                },
76                "creditCard": {
77                    "regex": "none",
78                    "alertText": "* Invalid credit card number"
79                },
80                "phone": {
81                    // credit: jquery.h5validate.js / orefalo
82                    "regex": /^([\+][0-9]{1,3}([ \.\-])?)?([\(][0-9]{1,6}[\)])?([0-9 \.\-]{1,32})(([A-Za-z \:]{1,11})?[0-9]{1,4}?)$/,
83                    "alertText": "* Invalid phone number"
84                },
85                "email": {
86                    // HTML5 compatible email regex ( http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#    e-mail-state-%28type=email%29 )
87                    "regex": /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
88                    "alertText": "* Invalid email address"
89                },
90                "fullname": {
91                    "regex":/^([a-zA-Z]+[\'\,\.\-]?[a-zA-Z ]*)+[ ]([a-zA-Z]+[\'\,\.\-]?[a-zA-Z ]+)+$/,
92                    "alertText":"* Must be first and last name"
93                },
94                "zip": {
95                    "regex":/^\d{5}$|^\d{5}-\d{4}$/,
96                    "alertText":"* Invalid zip format"
97                },
98                "integer": {
99                    "regex": /^[\-\+]?\d+$/,
100                    "alertText": "* Not a valid integer"
101                },
102                "number": {
103                    // Number, including positive, negative, and floating decimal. credit: orefalo
104                    "regex": /^[\-\+]?((([0-9]{1,3})([,][0-9]{3})*)|([0-9]+))?([\.]([0-9]+))?$/,
105                    "alertText": "* Invalid floating decimal number"
106                },
107                "date": {                    
108                    //	Check if date is valid by leap year
109			"func": function (field) {
110					var pattern = new RegExp(/^(\d{4})[\/\-\.](0?[1-9]|1[012])[\/\-\.](0?[1-9]|[12][0-9]|3[01])$/);
111					var match = pattern.exec(field.val());
112					if (match == null)
113					   return false;
114	
115					var year = match[1];
116					var month = match[2]*1;
117					var day = match[3]*1;					
118					var date = new Date(year, month - 1, day); // because months starts from 0.
119	
120					return (date.getFullYear() == year && date.getMonth() == (month - 1) && date.getDate() == day);
121				},                		
122			 "alertText": "* Invalid date, must be in YYYY-MM-DD format"
123                },
124                "ipv4": {
125                    "regex": /^((([01]?[0-9]{1,2})|(2[0-4][0-9])|(25[0-5]))[.]){3}(([0-1]?[0-9]{1,2})|(2[0-4][0-9])|(25[0-5]))$/,
126                    "alertText": "* Invalid IP address"
127                },
128                "url": {
129                    "regex": /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,
130                    "alertText": "* Invalid URL"
131                },
132                "onlyNumberSp": {
133                    "regex": /^[0-9\ ]+$/,
134                    "alertText": "* Numbers only"
135                },
136                "onlyLetterSp": {
137                    "regex": /^[a-zA-Z\ \']+$/,
138                    "alertText": "* Letters only"
139                },
140				"onlyLetterAccentSp":{
141                    "regex": /^[a-z\u00C0-\u017F\ ]+$/i,
142                    "alertText": "* Letters only (accents allowed)"
143                },
144                "onlyLetterNumber": {
145                    "regex": /^[0-9a-zA-Z]+$/,
146                    "alertText": "* No special characters allowed"
147                },
148                // --- CUSTOM RULES -- Those are specific to the demos, they can be removed or changed to your likings
149                "ajaxUserCall": {
150                    "url": "ajaxValidateFieldUser",
151                    // you may want to pass extra data on the ajax call
152                    "extraData": "name=eric",
153                    "alertText": "* This user is already taken",
154                    "alertTextLoad": "* Validating, please wait"
155                },
156				"ajaxUserCallPhp": {
157                    "url": "phpajax/ajaxValidateFieldUser.php",
158                    // you may want to pass extra data on the ajax call
159                    "extraData": "name=eric",
160                    // if you provide an "alertTextOk", it will show as a green prompt when the field validates
161                    "alertTextOk": "* This username is available",
162                    "alertText": "* This user is already taken",
163                    "alertTextLoad": "* Validating, please wait"
164                },
165                "ajaxNameCall": {
166                    // remote json service location
167                    "url": "ajaxValidateFieldName",
168                    // error
169                    "alertText": "* This name is already taken",
170                    // if you provide an "alertTextOk", it will show as a green prompt when the field validates
171                    "alertTextOk": "* This name is available",
172                    // speaks by itself
173                    "alertTextLoad": "* Validating, please wait"
174                },
175				 "ajaxNameCallPhp": {
176	                    // remote json service location
177	                    "url": "phpajax/ajaxValidateFieldName.php",
178	                    // error
179	                    "alertText": "* This name is already taken",
180	                    // speaks by itself
181	                    "alertTextLoad": "* Validating, please wait"
182	                },
183                "validate2fields": {
184                    "alertText": "* Please input HELLO"
185                },
186	            //tls warning:homegrown not fielded 
187                "dateFormat":{
188                    "regex": /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$|^(?:(?:(?
188:0?[13578]|1[02])(\/|-)31)|(?:(?:0?[1,3-9]|1[0-2])(\/|-)(?:29|30)))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^(?:(?:0?[1-9]|1[0-2])(\/|-)(?:0?[1-9]|1\d|2[0-8]))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^(0?2(\/|-)29)(\/|-)(?:(?:0[48]00|[13579][26]00|[2468][048]00)|(?:\d\d)?(?:0[48]|[2468][048]|[13579][26]))$/,
189                    "alertText": "* Invalid Date"
190                },
191                //tls warning:homegrown not fielded 
192				"dateTimeFormat": {
193	                "regex": /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])\s+(1[012]|0?[1-9]){1}:(0?[1-5]|[0-6][0-9]){1}:(0?[0-6]|[0-6][0-9]){1}\s+(am|pm|AM|PM){1}$|^(?:(?:(?:0?[13578]|1[02])(\/|-)31)|(?:(?:0?[1,3-9]|1[0-2])(\/|-)(?:29|30)))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^((1[012]|0?[1-9]){1}\/(0?[1-9]|[12][0-9]|3[01]){1}\/\d{2,4}\s+(1[012]|0?[1-9]){1}:(0?[1-5]|[0-6][0-9]){1}:(0?[0-6]|[0-6][0-9]){1}\s+(am|pm|AM|PM){1})$/,
194                    "alertText": "* Invalid Date or Date Format",
195                    "alertText2": "Expected Format: ",
196                    "alertText3": "mm/dd/yyyy hh:mm:ss AM|PM or ", 
197                    "alertText4": "yyyy-mm-dd hh:mm:ss AM|PM"
198	            }
199            };
200            
201        }
202    };
203
204    $.validationEngineLanguage.newLang();
205    
206})(jQuery);

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.