mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-14 13:16:28 +08:00
23 lines
704 B
JavaScript
23 lines
704 B
JavaScript
$.fn.clearFormErrors = function () {
|
|
$(this).find('.nav.nav-tabs li').removeClass('has-error');
|
|
$(this).find('.form-group').removeClass('has-error');
|
|
$(this).find('span.help-block').remove();
|
|
};
|
|
|
|
$.fn.clearFormFields = function () {
|
|
$(this).find("input")
|
|
.not("button")
|
|
.not('input[type="submit"], input[type="reset"], input[type="hidden"]')
|
|
.not('input[type="radio"]') // Leave out radios as this messes up Bootstrap btn-groups
|
|
.val('')
|
|
.removeAttr('checked')
|
|
.removeAttr('selected');
|
|
};
|
|
|
|
$.fn.removeBlankFileForms = function () {
|
|
$(this).find("input[type='file']").each(function () {
|
|
if (!this.files[0]) {
|
|
$(this).closest("fieldset").remove();
|
|
}
|
|
});
|
|
}
|