I am using bootstrapvalidator with Bootstrap 3.3
I need to reset a form in a modal dialog.
I used the right method but it does not work into the modal dialog.
$('#emailForm').bootstrapValidator("resetForm",true);
If I open the modal and insert an email, and then try to reset the form, the validation controls are still there.
JSFiddle
It is simple, you just only need to add
excluded: [':disabled'],
Into validation init.
Example:
$('#emailForm').bootstrapValidator({
feedbackIcons: {
valid: 'glyphicon glyphicon-ok',
invalid: 'glyphicon glyphicon-remove',
validating: 'glyphicon glyphicon-refresh'
},
excluded: [':disabled'],
fields: {
email: {
validators: {
emailAddress: {
message: 'The value is not a valid email address'
}
}
}
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With