Я использовал обратный вызов, наконец:
$('#userForm').bootstrapValidator({
message: 'This value is not valid',
feedbackIcons: {
valid: 'glyphicon glyphicon-ok',
invalid: 'glyphicon glyphicon-remove',
validating: 'glyphicon glyphicon-refresh'
},
submitHandler: function (validator, form, submitButton) {
},
excluded: [':disabled'],
fields: {
FName: {
validators: {
notEmpty: {
message: 'Required!'
}
}
},
LName: {
validators: {
notEmpty: {
message: 'Required!'
}
}
},
UserName: {
validators: {
notEmpty: {
message: 'Required!'
},
stringLength: {
min: 3,
max: 25,
message: 'Length should be between 3 to 25.'
}
}
},
Password: {
validators: {
notEmpty: {
message: 'Required!'
},
stringLength: {
min: 8,
max: 15,
message: 'Length should be between 8 to 5.'
},
callback: {
callback: function (value, validator, $field) {
var validv = true;
var messagev = '';
//Number
if (!value.match(/\d/)) {
validv = false;
messagev += 'Enter a number.<br />'
}
//Lowercase letter
if (!value.match(/[A-z]/)) {
validv = false;
messagev += 'Enter a lowercase charachter..<br />'
}
//Capital letter
if (!value.match(/[A-Z]/)) {
validv = false;
messagev += 'Enter a capital charachter.'
}
return {
valid: validv,
message: messagev
}
}
}
}
},
selectStatus: {
validators: {
notEmpty: {
message: 'Required!'
}
}
}
}
});