Closed speshulk926 closed 9 years ago
You are correct, currently there is nothing in the BMVC .js file that puts class has-success
on form-group. However, this is the javascript responsible for dealing with it (lines 6-19 of TwitterBootstrapMvc.js file):
if ($.validator && $('form').length > 0) {
$('form').each(function () {
$(this).validate().settings.highlight = function (element) {
$(element).closest('.control-group').addClass('error');
$(element).closest('.form-group').addClass('has-error');
};
});
$('form').each(function () {
$(this).validate().settings.unhighlight = function (element) {
$(element).closest('.control-group').removeClass('error');
$(element).closest('.form-group').removeClass('has-error');
};
});
}
You can tweak it a bit easily.
Do you know if/how it is possible to use the "has-success" similarly to how "has-error" works now? The user starts typing and once all validation passes it turns green. I don't seem to see anything on it anywhere. Any help would be appreciated!
http://getbootstrap.com/css/#forms-control-validation