clean form fix for snmp add modal

This commit is contained in:
gabryon99 2020-06-22 09:16:11 +02:00
parent 7a532c75aa
commit 6bba71a8de
6 changed files with 11 additions and 7 deletions

View file

@ -129,6 +129,7 @@
}
cleanForm() {
console.log(this);
/* remove validation fields and tracks */
$(this.element).find('input:visible,textarea:visible,select').each(function(i, input) {
$(this).removeClass(`is-valid`).removeClass(`is-invalid`);
@ -154,7 +155,7 @@
method(this.options.endpoint, dataToSend)
.done(function (response, textStatus) {
if (self.options.resetAfterSubmit) self.cleanForm();
self.options.onSubmitSuccess(response, dataToSend, self.cleanForm);
self.options.onSubmitSuccess(response, dataToSend, self);
/* unbind the old closure on submit event and bind a new one */
$(self.element).off('submit', self.submitHandler);
self.delegateSubmit();