|
1 | 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": "* Bidang ini wajib", |
10 | | - "alertTextCheckboxMultiple": "* Silahkan pilih pilihan", |
11 | | - "alertTextCheckboxe": "* Kotak centang ini wajib", |
12 | | - "alertTextDateRange": "* Kedua bidang rentang tanggal ini wajib" |
13 | | - }, |
14 | | - "requiredInFunction": { |
15 | | - "func": function(field, rules, i, options){ |
16 | | - return (field.val() == "test") ? true : false; |
17 | | - }, |
18 | | - "alertText": "* Bidang harus sama dengan uji" |
19 | | - }, |
20 | | - "dateRange": { |
21 | | - "regex": "none", |
22 | | - "alertText": "* Rentang Tanggal ", |
23 | | - "alertText2": "Tidak Sah" |
24 | | - }, |
25 | | - "dateTimeRange": { |
26 | | - "regex": "none", |
27 | | - "alertText": "* Rentang Tanggal Waktu ", |
28 | | - "alertText2": "Tidak Sah" |
29 | | - }, |
30 | | - "minSize": { |
31 | | - "regex": "none", |
32 | | - "alertText": "* Minimum ", |
33 | | - "alertText2": " karakter yang dibutuhkan" |
34 | | - }, |
35 | | - "maxSize": { |
36 | | - "regex": "none", |
37 | | - "alertText": "* Maksimum ", |
38 | | - "alertText2": " karakter yang dibutuhkan" |
39 | | - }, |
40 | | - "groupRequired": { |
41 | | - "regex": "none", |
42 | | - "alertText": "* Anda harus mengisi salah satu bidang berikut" |
43 | | - }, |
44 | | - "min": { |
45 | | - "regex": "none", |
46 | | - "alertText": "* Nilai minimalnya adalah " |
47 | | - }, |
48 | | - "max": { |
49 | | - "regex": "none", |
50 | | - "alertText": "* Nilai maksimum adalah " |
51 | | - }, |
52 | | - "past": { |
53 | | - "regex": "none", |
54 | | - "alertText": "* Tanggal sebelum " |
55 | | - }, |
56 | | - "future": { |
57 | | - "regex": "none", |
58 | | - "alertText": "* Tanggal sesudah " |
59 | | - }, |
60 | | - "maxCheckbox": { |
61 | | - "regex": "none", |
62 | | - "alertText": "* Maksimum ", |
63 | | - "alertText2": " pilihan yang diperbolehkan" |
64 | | - }, |
| 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": "* Bidang ini wajib", |
| 10 | + "alertTextCheckboxMultiple": "* Silahkan pilih pilihan", |
| 11 | + "alertTextCheckboxe": "* Kotak centang ini wajib", |
| 12 | + "alertTextDateRange": "* Kedua bidang rentang tanggal ini wajib" |
| 13 | + }, |
| 14 | + "requiredInFunction": { |
| 15 | + "func": function(field, rules, i, options){ |
| 16 | + return (field.val() == "test") ? true : false; |
| 17 | + }, |
| 18 | + "alertText": "* Bidang harus sama dengan uji" |
| 19 | + }, |
| 20 | + "dateRange": { |
| 21 | + "regex": "none", |
| 22 | + "alertText": "* Rentang Tanggal ", |
| 23 | + "alertText2": "Tidak Sah" |
| 24 | + }, |
| 25 | + "dateTimeRange": { |
| 26 | + "regex": "none", |
| 27 | + "alertText": "* Rentang Tanggal Waktu ", |
| 28 | + "alertText2": "Tidak Sah" |
| 29 | + }, |
| 30 | + "minSize": { |
| 31 | + "regex": "none", |
| 32 | + "alertText": "* Minimum ", |
| 33 | + "alertText2": " karakter yang dibutuhkan" |
| 34 | + }, |
| 35 | + "maxSize": { |
| 36 | + "regex": "none", |
| 37 | + "alertText": "* Maksimum ", |
| 38 | + "alertText2": " karakter yang dibutuhkan" |
| 39 | + }, |
| 40 | + "groupRequired": { |
| 41 | + "regex": "none", |
| 42 | + "alertText": "* Anda harus mengisi salah satu bidang berikut" |
| 43 | + }, |
| 44 | + "min": { |
| 45 | + "regex": "none", |
| 46 | + "alertText": "* Nilai minimalnya adalah " |
| 47 | + }, |
| 48 | + "max": { |
| 49 | + "regex": "none", |
| 50 | + "alertText": "* Nilai maksimum adalah " |
| 51 | + }, |
| 52 | + "past": { |
| 53 | + "regex": "none", |
| 54 | + "alertText": "* Tanggal sebelum " |
| 55 | + }, |
| 56 | + "future": { |
| 57 | + "regex": "none", |
| 58 | + "alertText": "* Tanggal sesudah " |
| 59 | + }, |
| 60 | + "maxCheckbox": { |
| 61 | + "regex": "none", |
| 62 | + "alertText": "* Maksimum ", |
| 63 | + "alertText2": " pilihan yang diperbolehkan" |
| 64 | + }, |
65 | 65 | "minCheckbox": { |
66 | 66 | "regex": "none", |
67 | 67 | "alertText": "* Silahkan pilih ", |
68 | 68 | "alertText2": " pilihan" |
69 | 69 | }, |
70 | | - "equals": { |
71 | | - "regex": "none", |
72 | | - "alertText": "* Bidang tidak cocok" |
73 | | - }, |
74 | | - "creditCard": { |
75 | | - "regex": "none", |
76 | | - "alertText": "* Nomor kartu kredit tidak sah" |
77 | | - }, |
78 | | - "phone": { |
79 | | - // credit: jquery.h5validate.js / orefalo |
80 | | - "regex": /^([\+][0-9]{1,3}[\ \.\-])?([\(]{1}[0-9]{2,6}[\)])?([0-9\ \.\-\/]{3,20})((x|ext|extension)[\ ]?[0-9]{1,4})?$/, |
81 | | - "alertText": "* Nomor telepon tidak sah" |
82 | | - }, |
83 | | - "email": { |
84 | | - // 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 ) |
85 | | - "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,}))$/, |
86 | | - "alertText": "* Alamat email tidak sah" |
87 | | - }, |
88 | | - "integer": { |
89 | | - "regex": /^[\-\+]?\d+$/, |
90 | | - "alertText": "* Bukan bilangan bulat yang sah" |
91 | | - }, |
92 | | - "number": { |
93 | | - // Number, including positive, negative, and floating decimal. credit: orefalo |
94 | | - "regex": /^[\-\+]?((([0-9]{1,3})([,][0-9]{3})*)|([0-9]+))?([\.]([0-9]+))?$/, |
95 | | - "alertText": "* Bukan angka desimal mengambang yang sah" |
96 | | - }, |
97 | | - "date": { |
98 | | - // Check if date is valid by leap year |
99 | | - "func": function (field) { |
100 | | - var pattern = new RegExp(/^(\d{4})[\/\-\.](0?[1-9]|1[012])[\/\-\.](0?[1-9]|[12][0-9]|3[01])$/); |
101 | | - var match = pattern.exec(field.val()); |
102 | | - if (match == null) |
103 | | - return false; |
104 | | - |
105 | | - var year = match[1]; |
106 | | - var month = match[2]*1; |
107 | | - var day = match[3]*1; |
108 | | - var date = new Date(year, month - 1, day); // because months starts from 0. |
109 | | - |
110 | | - return (date.getFullYear() == year && date.getMonth() == (month - 1) && date.getDate() == day); |
111 | | - }, |
112 | | - "alertText": "* Tanggal tidak sah, harus dalam format TTTT-BB-HH" |
113 | | - }, |
114 | | - "ipv4": { |
115 | | - "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]))$/, |
116 | | - "alertText": "* Alamat IP tidak sah" |
117 | | - }, |
118 | | - "url": { |
119 | | - "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, |
120 | | - "alertText": "* URL tidak sah" |
121 | | - }, |
122 | | - "onlyNumberSp": { |
123 | | - "regex": /^[0-9\ ]+$/, |
124 | | - "alertText": "* Angka saja" |
125 | | - }, |
126 | | - "onlyLetterSp": { |
127 | | - "regex": /^[a-zA-Z\ \']+$/, |
128 | | - "alertText": "* Huruf saja" |
129 | | - }, |
130 | | - "onlyLetterNumber": { |
131 | | - "regex": /^[0-9a-zA-Z]+$/, |
132 | | - "alertText": "* Karakter khusus tidak diperbolehkan" |
133 | | - }, |
134 | | - // --- CUSTOM RULES -- Those are specific to the demos, they can be removed or changed to your likings |
135 | | - "ajaxUserCall": { |
136 | | - "url": "ajaxValidateFieldUser", |
137 | | - // you may want to pass extra data on the ajax call |
138 | | - "extraData": "name=eric", |
139 | | - "alertText": "* Pengguna ini sudah diambil", |
140 | | - "alertTextLoad": "* Mengesahkan, silahkan tunggu" |
141 | | - }, |
142 | | - "ajaxUserCallPhp": { |
143 | | - "url": "phpajax/ajaxValidateFieldUser.php", |
144 | | - // you may want to pass extra data on the ajax call |
145 | | - "extraData": "name=eric", |
146 | | - // if you provide an "alertTextOk", it will show as a green prompt when the field validates |
147 | | - "alertTextOk": "* Nama pengguna ini tersedia", |
148 | | - "alertText": "* Pengguna ini sudah diambil", |
149 | | - "alertTextLoad": "* Mengesahkan, silahkan tunggu" |
150 | | - }, |
151 | | - "ajaxNameCall": { |
152 | | - // remote json service location |
153 | | - "url": "ajaxValidateFieldName", |
154 | | - // error |
155 | | - "alertText": "* Nama ini sudah diambil", |
156 | | - // if you provide an "alertTextOk", it will show as a green prompt when the field validates |
157 | | - "alertTextOk": "* Nama ini tersedia", |
158 | | - // speaks by itself |
159 | | - "alertTextLoad": "* Mengesahkan, silahkan tunggu" |
160 | | - }, |
161 | | - "ajaxNameCallPhp": { |
162 | | - // remote json service location |
163 | | - "url": "phpajax/ajaxValidateFieldName.php", |
164 | | - // error |
165 | | - "alertText": "* Nama ini sudah diambil", |
166 | | - // speaks by itself |
167 | | - "alertTextLoad": "* Mengesahkan, silahkan tunggu" |
168 | | - }, |
169 | | - "validate2fields": { |
170 | | - "alertText": "* Silakan masukan HELLO" |
171 | | - }, |
172 | | - //tls warning:homegrown not fielded |
173 | | - "dateFormat":{ |
174 | | - "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]))$/, |
175 | | - "alertText": "* Tanggal Tidak Sah" |
176 | | - }, |
177 | | - //tls warning:homegrown not fielded |
178 | | - "dateTimeFormat": { |
179 | | - "regex": /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])\s+([01]?[0-9]|2[0-3]){1}:(0?[1-5]|[0-5][0-9]){1}:(0?[0-6]|[0-5][0-9]){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+([01]?[0-9]|2[0-3]){1}:(0?[1-5]|[0-5][0-9]){1}:(0?[0-9]|[0-5][0-9]){1})$/, |
180 | | - "alertText": "* Tanggal atau Format Tanggal Tidak Sah", |
181 | | - "alertText2": "Format yang diharapkan: ", |
182 | | - "alertText3": "bb/hh/tttt jj:mm:dd atau ", |
183 | | - "alertText4": "tttt-bb-hh jj:mm:dd" |
184 | | - }, |
| 70 | + "equals": { |
| 71 | + "regex": "none", |
| 72 | + "alertText": "* Bidang tidak cocok" |
| 73 | + }, |
| 74 | + "creditCard": { |
| 75 | + "regex": "none", |
| 76 | + "alertText": "* Nomor kartu kredit tidak sah" |
| 77 | + }, |
| 78 | + "phone": { |
| 79 | + // credit: jquery.h5validate.js / orefalo |
| 80 | + "regex": /^([\+][0-9]{1,3}[\ \.\-])?([\(]{1}[0-9]{2,6}[\)])?([0-9\ \.\-\/]{3,20})((x|ext|extension)[\ ]?[0-9]{1,4})?$/, |
| 81 | + "alertText": "* Nomor telepon tidak sah" |
| 82 | + }, |
| 83 | + "email": { |
| 84 | + // 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 ) |
| 85 | + "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,}))$/, |
| 86 | + "alertText": "* Alamat email tidak sah" |
| 87 | + }, |
| 88 | + "integer": { |
| 89 | + "regex": /^[\-\+]?\d+$/, |
| 90 | + "alertText": "* Bukan bilangan bulat yang sah" |
| 91 | + }, |
| 92 | + "number": { |
| 93 | + // Number, including positive, negative, and floating decimal. credit: orefalo |
| 94 | + "regex": /^[\-\+]?((([0-9]{1,3})([,][0-9]{3})*)|([0-9]+))?([\.]([0-9]+))?$/, |
| 95 | + "alertText": "* Bukan angka desimal mengambang yang sah" |
| 96 | + }, |
| 97 | + "date": { |
| 98 | + // Check if date is valid by leap year |
| 99 | + "func": function (field) { |
| 100 | + var pattern = new RegExp(/^(\d{4})[\/\-\.](0?[1-9]|1[012])[\/\-\.](0?[1-9]|[12][0-9]|3[01])$/); |
| 101 | + var match = pattern.exec(field.val()); |
| 102 | + if (match == null) |
| 103 | + return false; |
| 104 | + |
| 105 | + var year = match[1]; |
| 106 | + var month = match[2]*1; |
| 107 | + var day = match[3]*1; |
| 108 | + var date = new Date(year, month - 1, day); // because months starts from 0. |
| 109 | + |
| 110 | + return (date.getFullYear() == year && date.getMonth() == (month - 1) && date.getDate() == day); |
| 111 | + }, |
| 112 | + "alertText": "* Tanggal tidak sah, harus dalam format TTTT-BB-HH" |
| 113 | + }, |
| 114 | + "ipv4": { |
| 115 | + "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]))$/, |
| 116 | + "alertText": "* Alamat IP tidak sah" |
| 117 | + }, |
| 118 | + "url": { |
| 119 | + "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, |
| 120 | + "alertText": "* URL tidak sah" |
| 121 | + }, |
| 122 | + "onlyNumberSp": { |
| 123 | + "regex": /^[0-9\ ]+$/, |
| 124 | + "alertText": "* Angka saja" |
| 125 | + }, |
| 126 | + "onlyLetterSp": { |
| 127 | + "regex": /^[a-zA-Z\ \']+$/, |
| 128 | + "alertText": "* Huruf saja" |
| 129 | + }, |
| 130 | + "onlyLetterNumber": { |
| 131 | + "regex": /^[0-9a-zA-Z]+$/, |
| 132 | + "alertText": "* Karakter khusus tidak diperbolehkan" |
| 133 | + }, |
| 134 | + // --- CUSTOM RULES -- Those are specific to the demos, they can be removed or changed to your likings |
| 135 | + "ajaxUserCall": { |
| 136 | + "url": "ajaxValidateFieldUser", |
| 137 | + // you may want to pass extra data on the ajax call |
| 138 | + "extraData": "name=eric", |
| 139 | + "alertText": "* Pengguna ini sudah diambil", |
| 140 | + "alertTextLoad": "* Mengesahkan, silahkan tunggu" |
| 141 | + }, |
| 142 | + "ajaxUserCallPhp": { |
| 143 | + "url": "phpajax/ajaxValidateFieldUser.php", |
| 144 | + // you may want to pass extra data on the ajax call |
| 145 | + "extraData": "name=eric", |
| 146 | + // if you provide an "alertTextOk", it will show as a green prompt when the field validates |
| 147 | + "alertTextOk": "* Nama pengguna ini tersedia", |
| 148 | + "alertText": "* Pengguna ini sudah diambil", |
| 149 | + "alertTextLoad": "* Mengesahkan, silahkan tunggu" |
| 150 | + }, |
| 151 | + "ajaxNameCall": { |
| 152 | + // remote json service location |
| 153 | + "url": "ajaxValidateFieldName", |
| 154 | + // error |
| 155 | + "alertText": "* Nama ini sudah diambil", |
| 156 | + // if you provide an "alertTextOk", it will show as a green prompt when the field validates |
| 157 | + "alertTextOk": "* Nama ini tersedia", |
| 158 | + // speaks by itself |
| 159 | + "alertTextLoad": "* Mengesahkan, silahkan tunggu" |
| 160 | + }, |
| 161 | + "ajaxNameCallPhp": { |
| 162 | + // remote json service location |
| 163 | + "url": "phpajax/ajaxValidateFieldName.php", |
| 164 | + // error |
| 165 | + "alertText": "* Nama ini sudah diambil", |
| 166 | + // speaks by itself |
| 167 | + "alertTextLoad": "* Mengesahkan, silahkan tunggu" |
| 168 | + }, |
| 169 | + "validate2fields": { |
| 170 | + "alertText": "* Silakan masukan HELLO" |
| 171 | + }, |
| 172 | + //tls warning:homegrown not fielded |
| 173 | + "dateFormat":{ |
| 174 | + "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]))$/, |
| 175 | + "alertText": "* Tanggal Tidak Sah" |
| 176 | + }, |
| 177 | + //tls warning:homegrown not fielded |
| 178 | + "dateTimeFormat": { |
| 179 | + "regex": /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])\s+([01]?[0-9]|2[0-3]){1}:(0?[1-5]|[0-5][0-9]){1}:(0?[0-6]|[0-5][0-9]){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+([01]?[0-9]|2[0-3]){1}:(0?[1-5]|[0-5][0-9]){1}:(0?[0-9]|[0-5][0-9]){1})$/, |
| 180 | + "alertText": "* Tanggal atau Format Tanggal Tidak Sah", |
| 181 | + "alertText2": "Format yang diharapkan: ", |
| 182 | + "alertText3": "bb/hh/tttt jj:mm:dd atau ", |
| 183 | + "alertText4": "tttt-bb-hh jj:mm:dd" |
| 184 | + }, |
185 | 185 |
|
186 | 186 | } |
187 | 187 | }; |
|
0 commit comments