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:
LaustAxelsen 2015-01-06 22:24:54 +01:00
parent fb47da210f
commit 0b0e0a1b49
1 changed files with 6 additions and 0 deletions

View File

@ -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;