Well, baptism by fire, but got er done. I had to break these up, which is really what I wanted to do anyways, so that individual Alert Texts could be used for the different criteria required and not one general invalid password message. With the help of regexlib.com I was able to add numerous custom validations within jquery.validationEngine-en.js The minSize[n]
and required
are already built into the jQuery Validation, so not showing those.
"minLowerAlphaChars": {
// requires at least one lower case alpha character
"regex": /^(.*[a-z].*)/,
"alertText": "* Must include 1 lowercase character"
},
"minUpperAlphaChars": {
// requires at least one UPPER case alpha character
"regex": /^(.*[A-Z].*)/,
"alertText": "* Must include 1 uppercase character"
},
"minSpecialChars": {
// requires at least one SPECIAL character of the list in regex
"regex": /^(?=.*[!@#$%&*()_+}])/,
"alertText": "* Must include 1 special character"
},
"minNumberChars": {
// requires at least one NUMERIC
"regex": /^(?=.*\d)/,
"alertText": "* Must include 1 numberic"
},
"noFirstNumber": {
// requires first charecter NOT be NUMERIC
"regex": /^(?!\d)/,
"alertText": "* First Character can not be numberic"
},
Usage;
<input type="password" class="validate[required,minSize[8],custom[minNumberChars],custom[minSpecialChars],custom[noFirstNumber],custom[minUpperAlphaChars],custom[minLowerAlphaChars]]" name="password1" id="password1" size="44">