first commit
This commit is contained in:
18
plugins/jquery-validation/polish/validator.city.js
Normal file
18
plugins/jquery-validation/polish/validator.city.js
Normal file
@@ -0,0 +1,18 @@
|
||||
/* eslint-disable func-names */
|
||||
|
||||
/* Validator city */
|
||||
jQuery.validator.addMethod(
|
||||
"city",
|
||||
function(value, element) {
|
||||
/* eslint-disable max-len */
|
||||
const reg = /^[a-zA-ZąĄęĘóśŚÓłŁżŻźŹćĆńŃÄäÖöÜüß]{2,}((\s?-\s?|\s)[a-zA-ZąĄęĘóśŚÓłŁżŻźŹćĆńŃÄäÖöÜüß]{2,}\.?)*$/;
|
||||
/* eslint-enable max-len */
|
||||
return this.optional(element) || reg.test(value);
|
||||
},
|
||||
"Wprowadź poprawnie nazwę miasta."
|
||||
);
|
||||
|
||||
/* City validator */
|
||||
jQuery.validator.addClassRules("js-validation-city", {
|
||||
city: true,
|
||||
});
|
||||
Reference in New Issue
Block a user