PageSourceSearch

https://www.tangmei.com.tw/scripts/validationEngine/jquery.validationEngine-zh_TW.js

js tangmei.com.tw collected 2026-10-07 02:01:50 UTC 9,954 bytes, 216 lines download raw bytes

1(function($){
2$.fn.validationEngineLanguage = function(){
3};
4	$.validationEngineLanguage = {
5		newLang: function(){
6			$.validationEngineLanguage.allRules = {
7				"required": {
8					// Add your regex rules here, you can take telephone as an example
9					"regex": "none",
10					"alertText": "* 此欄位不可空白",
11					"alertTextCheckboxMultiple": "* 請選擇一個項目",
12					"alertTextCheckboxe": "* 您必需勾選此欄位",
13					"alertTextDateRange": "* 日期範圍欄位都不可空白"
14				},
15				"rocid": { 
16					"func": function(field, rules, i, options){
17					  tab = "ABCDEFGHJKLMNPQRSTUVXYWZIO"                     
18					A1 = new Array (1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3 );
19					A2 = new Array (0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5 );
20					Mx = new Array (9,8,7,6,5,4,3,2,1,1);
21
22					if ( field.val().length != 10 ) return false;
23					i = tab.indexOf( field.val().charAt(0) );
24					if ( i == -1 ) return false;
25					sum = A1[i] + A2[i]*9;
26
27					for ( i=1; i<10; i++ ) {
28						v = parseInt( field.val().charAt(i) );
29						if ( isNaN(v) ) return false;
30						sum = sum + v * Mx[i];
31					}
32					if ( sum % 10 != 0 ) return false;
33						return true;						
34					},
35					"alertText": "* 無效的身份證字號"
36				},
37				"requiredInFunction": { 
38					"func": function(field, rules, i, options){
39						return (field.val() == "test") ? true : false;
40					},
41					"alertText": "* Field must equal test"
42				},
43				"dateRange": {
44					"regex": "none",
45					"alertText": "* 無效的 ",
46					"alertText2": " 日期範圍"
47				},
48				"dateTimeRange": {
49					"regex": "none",
50					"alertText": "* 無效的 ",
51					"alertText2": " 時間範圍"
52				},
53				"minSize": {
54					"regex": "none",
55					"alertText": "* 最少 ",
56					"alertText2": " 個字元"
57				},
58				"maxSize": {
59					"regex": "none",
60					"alertText": "* 最多 ",
61					"alertText2": " 個字元"
62				},
63				"groupRequired": {
64					"regex": "none",
65					"alertText": "* 你必需選填其中一個欄位"
66				},
67				"min": {
68					"regex": "none",
69					"alertText": "* 最小值為 "
70				},
71				"max": {
72					"regex": "none",
73					"alertText": "* 最大值為 "
74				},
75				"past": {
76					"regex": "none",
77					"alertText": "* 日期必需早於 "
78				},
79				"future": {
80					"regex": "none",
81					"alertText": "* 日期必需晚於 "
82				},	
83				"maxCheckbox": {
84					"regex": "none",
85					"alertText": "* 最多選取 ",
86					"alertText2": " 個項目"
87				},
88				"minCheckbox": {
89					"regex": "none",
90					"alertText": "* 請選取 ",
91					"alertText2": " 個項目"
92				},
93				"equals": {
94					"regex": "none",
95					"alertText": "* 密碼與確認密碼欄位內容不相符"
96				},
97				"creditCard": {
98					"regex": "none",
99					"alertText": "* 无效的信用卡号码"
100				},
101				"phone": {
102					// credit: jquery.h5validate.js / orefalo
103					"regex": /^([\+][0-9]{1,3}[ \.\-])?([\(]{1}[0-9]{2,6}[\)])?([0-9 \.\-\/]{3,20})((x|ext|extension)[ ]?[0-9]{1,4})?$/,
104					"alertText": "* 無效的電話號碼"
105				},
106				"email": {
107					// Shamelessly lifted from Scott Gonzalez via the Bassistance Validation plugin http://projects.scottsplayground.com/email_address_validation/
108					"regex": /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([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])))\.?$/i,
109					"alertText": "* E-mail格式錯誤"
110				},
111				"integer": {
112					"regex": /^[\-\+]?\d+$/,
113					"alertText": "* 不是有效的整數"
114				},
115				"number": {
116					// Number, including positive, negative, and floating decimal. credit: orefalo
117					"regex": /^[\-\+]?((([0-9]{1,3})([,][0-9]{3})*)|([0-9]+))?([\.]([0-9]+))?$/,
118					"alertText": "* 無效的數字"
119				},
120				"date": {
121					"regex": /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/,
122					"alertText": "* 無效的日期,格式必需為 YYYY-MM-DD"
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": "* 無效的 IP 位址"
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": "* 只能填數字"
135				},
136				"onlyLetterSp": {
137					"regex": /^[a-zA-Z\ \']+$/,
138					"alertText": "* 只接受英文字母大小寫"
139				},
140				"onlyLetterNumber": {
141					"regex": /^[0-9a-zA-Z]+$/,
142					"alertText": "* 不接受特殊字元"
143				},
144				// --- CUSTOM RULES -- Those are specific to the demos, they can be removed or changed to your likings
145				"ajaxUserCall": {
146					"url": "ajaxValidateFieldUser",
147					// you may want to pass extra data on the ajax call
148					"extraData": "name=eric",
149					"alertText": "* 此名稱已經被其他人使用",
150					"alertTextLoad": "* 正在確認名稱是否有其他人使用,請稍等。"
151				},
152				"ajaxUserData": {
153					"url": "/ajax/checkuserdata.htm",
154					"extraData": "name=eric",
155					"alertText": "* 資料格式錯誤!",
156					"alertTextLoad": "* 正在確認資料,請稍等。"
157				},
158				"ajaxUserCallPhp": {
159					"url": "/ajax/checkaccount.htm",
160					"alertTextOk": "* 此帳號名稱可以使用",
161					"alertText": "* 此帳號名稱已經被其他人使用",
162					"alertTextLoad": "* 正在確認帳號名稱是否有其他人使用,請稍等。"
163				},
164				"ajaxPasswordPhp": {
165					"url": "/ajax/checkpassword.htm",
166					"alertTextOk": "* 此密碼可以使用",
167					"alertText": "* 密碼格式錯誤,格式需為英文大小寫與數字混合,長度為6~12個字元",
168					"alertTextLoad": "* 正在確認密碼格式,請稍等。"
169				},
170				"ajaxNameCall": {
171					// remote json service location
172					"url": "ajaxValidateFieldName",
173					// error
174					"alertText": "* 此名稱可以使用",
175					// if you provide an "alertTextOk", it will show as a green prompt when the field validates
176					"alertTextOk": "* 此名稱已經被其他人使用",
177					// speaks by itself
178					"alertTextLoad": "* 正在確認名稱是否有其他人使用,請稍等。"
179				},
180				"ajaxOrderNumberCallPhp": {
181					// remote json service location
182					"url": "/ajax/payfrom.htm",
183					// error
184					"alertText": "* 查無此訂單編號,請您確認,謝謝您。",
185					// speaks by itself
186					"alertTextLoad": "* 確認有無訂單中。"
187				},
188				"ajaxMemberPhoneCallPhp": {
189					// remote json service location
190					"url": "/ajax/memberphone.htm",
191					// error
192					"alertText": "* 無效的電話號碼,請您確認,謝謝您。",
193					// speaks by itself
194					"alertTextLoad": "* 確認格式中。"
195				},
196				"validate2fields": {
197					"alertText": "* 請輸入 HELLO"
198				},
199				//tls warning:homegrown not fielded 
200				"dateFormat":{
201					"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]))$/,
202					"alertText": "* 無效的日期格式"
203				},
204				//tls warning:homegrown not fielded 
205				"dateTimeFormat": {
206					"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})$/,
207					"alertText": "* 無效的日期或時間格式",
208					"alertText2": "可接受的格式: ",
209					"alertText3": "mm/dd/yyyy hh:mm:ss AM|PM 或 ", 
210					"alertText4": "yyyy-mm-dd hh:mm:ss AM|PM"
211				}
212			};
213		}
214	};
215	$.validationEngineLanguage.newLang();
216})(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.