1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
| jQuery.fn.validationEngine = function(settings) {
if($.validationEngineLanguage){ // IS THERE A LANGUAGE LOCALISATION ?
allRules = $.validationEngineLanguage.allRules
}else{
allRules = {"required":{ // Add your regex rules here, you can take telephone as an example
"regex":"none",
"alertText":"* This field is required",
"alertTextCheckboxMultiple":"* Please select an option",
"alertTextCheckboxe":"* This checkbox is required"},
"length":{
"regex":"none",
"alertText":"*Between ",
"alertText2":" and ",
"alertText3": " characters allowed"},
"minCheckbox":{
"regex":"none",
"alertText":"* Checks allowed Exceeded"},
"confirm":{
"regex":"none",
"alertText":"* Your field is not matching"},
"telephone":{
"regex":"/^[0-9\-\(\)\ ]+$/",
"alertText":"* Invalid phone number"},
"email":{
"regex":"/^[a-zA-Z0-9_\.\-]+\@([a-zA-Z0-9\-]+\.)+[a-zA-Z0-9]{2,4}$/",
"alertText":"* Invalid email address"},
"date":{
"regex":"/^[0-9]{4}\-\[0-9]{1,2}\-\[0-9]{1,2}$/",
"alertText":"<strong>* Invalid date, must be in YYYY-MM-DD format"},
"onlyNumber":{
"regex":"/^[0-9\ ]+$/",
"alertText":"* Numbers only"},
"noSpecialCaracters":{
"regex":"/^[0-9a-zA-Z]+$/",
"alertText":"* No special caracters allowed"},
"onlyLetter":{
"regex":"/^[a-zA-Z\ \']+$/",
"alertText":"* Letters only"},
"check_pseudo":{
"regex":"none",
"alertText":"pseudo deja pris"
}
}
} |
Partager