Bootstrap validator for modal doesnt reset Form
The hidden.bs.modal
event is fired when the modal has finished being hidden from the user, So the form will be hidden And BoostarpValidator doesn't treat or validate by default the hidden fields.
So in order to reset your form when the modal being hidden, you should add:
excluded: ':disabled'
to your JS code.
Live example: http://jsfiddle.net/Arkni/ndpv76bk/
Reference:
excluded
docs : http://bootstrapvalidator.com/settings/#form-excluded
EDIT
Your initialization of bootstrapValidator on your form should be like the following after adding the excluded
option:
$('#addNodeForm').bootstrapValidator({
feedbackIcons: {
valid: 'glyphicon glyphicon-ok',
invalid: 'glyphicon glyphicon-remove',
validating: 'glyphicon glyphicon-refresh'
},
excluded: ':disabled', // <=== Adding the 'excluded' option
fields: {
nodename: {
validators: {
notEmpty: {
message: 'Function name is required'
}
}
}
}
});
Try following code :
$('#contactform').bootstrapValidator('resetForm', true);