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