I'm using Bootstrap Validator plugin to validate my form and I'm trying to do an alert when the form is successfully validated.
HTML
<form id="defaultForm" role="form">
<div class="form-group">
<label for="eventName">Event Name</label>
<input type="text" class="input-sm form-control" id="eventName" name="name" placeholder="...">
</div>
<button class="btn btn-sm">Add</button>
</form>
JS
$('#defaultForm').bootstrapValidator({
live: 'enabled',
fields: {
name: {
validators: {
notEmpty: {
message: 'The Evenr Name is required and cannot be empty',
onSuccess: function(e, data) {
alert('Success');
}
},
}
}
}
});
I've tried this according to this https://github.com/nghuuphuoc/bootstrapvalidator/issues/195
My form is validating but its not alerting the message on success. How can I alert it properly?