PageSourceSearch

https://rishiprasad.org/validationEngine/jquery.validationEngine-en.js

js rishiprasad.org collected 2026-10-02 01:07:52 UTC 11,066 bytes, 252 lines download raw bytes

1(function($){
2$.fn.validationEngineLanguage = function(){
3};
4$.validationEngineLanguage = {
5newLang: 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){
16return (field.val() == "test") ? true : false;
17},
18
19"alertText": "* Field must equal test"
20},
21"dateRange": {
22"regex": "none",
23"alertText": "* Invalid ",
24"alertText2": "Date Range"
25},
26"fname": { // Add your regex rules here, you can take telephone as an example
27                    "regex": "none",
28                    "alertText": "* First Name Required ",
29                    "alertTextCheckboxMultiple": "* Please select an option",
30                    "alertTextCheckboxe": "* This checkbox is required",
31                    "alertTextDateRange": "* Both date range fields are required"
32                },
33"checkFileType": { // Add your regex rules here, you can take telephone as an example
34                    "regex": "none",
35                    "alertText": "* Wrong file type",
36                    "alertTextCheckboxMultiple": "* Please select an option",
37                    "alertTextCheckboxe": "* This checkbox is required",
38                    "alertTextDateRange": "* Both date range fields are required"
39                },
40"lname": { // Add your regex rules here, you can take telephone as an example
41                    "regex": "none",
42                    "alertText": "* Last Name Required ",
43                    "alertTextCheckboxMultiple": "* Please select an option",
44                    "alertTextCheckboxe": "* This checkbox is required",
45                    "alertTextDateRange": "* Both date range fields are required"
46                },
47"email1": { // Add your regex rules here, you can take telephone as an example
48                    "regex": "none",
49                    "alertText": "* Email Required ",
50                    "alertTextCheckboxMultiple": "* Please select an option",
51                    "alertTextCheckboxe": "* This checkbox is required",
52                    "alertTextDateRange": "* Both date range fields are required"
53                },
54"pwd": { // Add your regex rules here, you can take telephone as an example
55                    "regex": "none",
56                    "alertText": "* Password Required ",
57                    "alertTextCheckboxMultiple": "* Please select an option",
58                    "alertTextCheckboxe": "* This checkbox is required",
59                    "alertTextDateRange": "* Both date range fields are required"
60                },
61"day": { // Add your regex rules here, you can take telephone as an example
62                    "regex": "none",
63                    "alertText": "* Select Day",
64                    "alertTextCheckboxMultiple": "* Please select an option",
65                    "alertTextCheckboxe": "* This checkbox is required",
66                    "alertTextDateRange": "* Both date range fields are required"
67                },
68"month": { // Add your regex rules here, you can take telephone as an example
69                    "regex": "none",
70                    "alertText": "* Select  Month",
71                    "alertTextCheckboxMultiple": "* Please select an option",
72                    "alertTextCheckboxe": "* This checkbox is required",
73                    "alertTextDateRange": "* Both date range fields are required"
74                },
75"year": { // Add your regex rules here, you can take telephone as an example
76                    "regex": "none",
77                    "alertText": "* Select Year",
78                    "alertTextCheckboxMultiple": "* Please select an option",
79                    "alertTextCheckboxe": "* This checkbox is required",
80                    "alertTextDateRange": "* Both date range fields are required"
81                },
82"dateTimeRange": {
83"regex": "none",
84"alertText": "* Invalid ",
85"alertText2": "Date Time Range"
86},
87"minSize": {
88"regex": "none",
89"alertText": "* Minimum ",
90"alertText2": " characters Required"
91},
92"maxSize": {
93"regex": "none",
94"alertText": "* Maximum ",
95"alertText2": " characters allowed"
96},
97"groupRequired": {
98"regex": "none",
99"alertText": "* You must fill one of the following fields"
100},
101"min": {
102"regex": "none",
103"alertText": "* Minimum value is "
104},
105"max": {
106"regex": "none",
107"alertText": "* Maximum value is "
108},
109"past": {
110"regex": "none",
111"alertText": "* Date prior to "
112},
113"future": {
114"regex": "none",
115"alertText": "* Date past "
116},
117"maxCheckbox": {
118"regex": "none",
119"alertText": "* Maximum ",
120"alertText2": " options allowed"
121},
122"minCheckbox": {
123"regex": "none",
124"alertText": "* Please select ",
125"alertText2": " option"
126},
127"equals": {
128"regex": "none",
129"alertText": "* Your passwords do not match"
130},
131"creditCard": {
132"regex": "none",
133"alertText": "* Invalid credit card number"
134},
135"phone": {
136// credit: jquery.h5validate.js / orefalo
137"regex": /^([\+][0-9]{1,3}[\ \.\-])?([\(]{1}[0-9]{2,6}[\)])?([0-9\ \.\-\/]{3,20})((x|ext|extension)[\ ]?[0-9]{1,4})?$/,
138"alertText": "* Invalid phone number"
139},
140"phone": {
141// credit: jquery.h5validate.js / orefalo
142"regex": (/\.(gif|jpg|jpeg|tiff|png)$/i),
143"alertText": "* file Type"
144},
145"email": {
146// 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 )
147"regex": /[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}/igm,
148"alertText": "* Invalid email address"
149},
150"integer": {
151"regex": /^[\-\+]?\d+$/,
152"alertText": "* Not a valid integer"
153},
154"number": {
155// Number, including positive, negative, and floating decimal. credit: orefalo
156"regex": /^[\-\+]?((([0-9]{1,3})([,][0-9]{3})*)|([0-9]+))?([\.]([0-9]+))?$/,
157"alertText": "* Only Numeric values allowed"
158},
159"date": {
160// Check if date is valid by leap year
161"func": function (field) {
162var pattern = new RegExp(/^(\d{4})[\/\-\.](0?[1-9]|1[012])[\/\-\.](0?[1-9]|[12][0-9]|3[01])$/);
163var match = pattern.exec(field.val());
164if (match == null)
165return false;
166var year = match[1];
167var month = match[2]*1;
168var day = match[3]*1;
169var date = new Date(year, month - 1, day); // because months starts from 0.
170return (date.getFullYear() == year && date.getMonth() == (month - 1) && date.getDate() == day);
171},
172"alertText": "* Invalid date, must be in YYYY-MM-DD format"
173},
174"ipv4": {
175"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]))$/,
176"alertText": "* Invalid IP address"
177},
178"url": {
179"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,
180"alertText": "* Invalid URL"
181},
182"onlyNumberSp": {
183"regex": /^[0-9\ ]+$/,
184"alertText": "* Numbers only"
185},
186"onlyLetterSp": {
187"regex": /^[a-zA-Z\ \']+$/,
188"alertText": "* Letters only"
189},
190"onlyLetterNumber": {
191"regex": /^[0-9a-zA-Z]+$/,
192"alertText": "* No special characters allowed"
193},
194// --- CUSTOM RULES -- Those are specific to the demos, they can be removed or changed to your likings
195"ajaxUserCall": {
196"url": "ajaxValidateFieldUser",
197// you may want to pass extra data on the ajax call
198"extraData": "name=eric",
199"alertText": "* This user is already taken",
200"alertTextLoad": "* Validating, please wait"
201},
202"ajaxUserCallPhp": {
203"url": "phpajax/ajaxValidateFieldUser.php",
204// you may want to pass extra data on the ajax call
205"extraData": "name=eric",
206// if you provide an "alertTextOk", it will show as a green prompt when the field validates
207"alertTextOk": "* This username is available",
208"alertText": "* This user is already taken",
209"alertTextLoad": "* Validating, please wait"
210},
211"ajaxNameCall": {
212// remote json service location
213"url": "ajaxValidateFieldName",
214// error
215"alertText": "* This name is already taken",
216// if you provide an "alertTextOk", it will show as a green prompt when the field validates
217"alertTextOk": "* This name is available",
218// speaks by itself
219"alertTextLoad": "* Validating, please wait"
220},
221"ajaxNameCallPhp": {
222// remote json service location
223"url": "phpajax/ajaxValidateFieldName.php",
224// error
225"alertText": "* This name is already taken",
226// speaks by itself
227"alertTextLoad": "* Validating, please wait"
228},
229"validate2fields": {
230"alertText": "* Please input HELLO"
231},
232//tls warning:homegrown not fielded
233"dateFormat":{
234"regex": /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$|^(?:(?:(?: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]))$/,
235"alertText": "* Invalid Date"
236},
237//tls warning:homegrown not fielded
238"dateTimeFormat": {
239"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})$/,
240"alertText": "* Invalid Date or Date Format",
241"alertText2": "Expected Format: ",
242"alertText3": "mm/dd/yyyy hh:mm:ss AM|PM or ",
243"alertText4": "yyyy-mm-dd hh:mm:ss AM|PM"
244}
245};
246}
247};
248//if (field.attr("title") != null) promptText = field.attr("title");
249
250
251$.validationEngineLanguage.newLang();
252})(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.