mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-15 13:45:25 +08:00
a1e6392a45
* Fix bugs with jquery3 upgrade [SCI-8973] * Remove deprecated jquery method (.error, .completed, .success) [SCI-8973] * Fix linter error [SCI-8973]
23 lines
706 B
JavaScript
23 lines
706 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('')
|
|
.attr('checked', false)
|
|
.attr('selected', false);
|
|
};
|
|
|
|
$.fn.removeBlankFileForms = function () {
|
|
$(this).find("input[type='file']").each(function () {
|
|
if (!this.files[0]) {
|
|
$(this).closest("fieldset").remove();
|
|
}
|
|
});
|
|
}
|