I'm using bootstrapvalidator and it works fine with the following.
$('.login-form').bootstrapValidator({
message: 'This value is not valid',
feedbackIcons: {
valid: 'glyphicon glyphicon-ok',
invalid: 'glyphicon glyphicon-remove',
validating: 'glyphicon glyphicon-refresh'
},
fields: {
password: {
validators: {
notEmpty: {
message: 'The password is required and cannot be empty'
}
}
},
email: {
validators: {
notEmpty: {
message: 'The email is required and cannot be empty'
},
emailAddress: {
message: 'The input is not a valid email address'
}
}
}
}
});
My submit action submits an ajax request to the server which answers for example in json
errors: {user: 'Username does not exist', password: 'wrong password'}
How can I manually trigger these server errors on the bootstrapvalidator form input fields?