Update main.js
Include two new basic rules; - isWords (a-z, not case sensitive and spaces e.g. "this is a pretty cat") - isWordsSpecial (a-z, special european letters, not case sensitive and spaces e.g. "sikke en flot ø" or "touché")
This commit is contained in:
parent
fb47da210f
commit
0b0e0a1b49
|
|
@ -16,6 +16,12 @@ var validationRules = {
|
|||
'isAlpha': function (value) {
|
||||
return value.match(/^[a-zA-Z]+$/);
|
||||
},
|
||||
'isWords': function (value) {
|
||||
return value.match(/^[a-zA-Z\s]+$/);
|
||||
},
|
||||
'isWordsSpecial': function (value) {
|
||||
return value.match(/^[a-zA-Z\s\u00C0-\u017F]+$/);
|
||||
},
|
||||
isLength: function (value, min, max) {
|
||||
if (max !== undefined) {
|
||||
return value.length >= min && value.length <= max;
|
||||
|
|
|
|||
Loading…
Reference in New Issue