Skip to content
Snippets Groups Projects
Commit 5816533c authored by Rafael Ostertag's avatar Rafael Ostertag
Browse files

Remove validation states right before submit(). Not on save click.

parent 80e833be
No related branches found
No related tags found
No related merge requests found
...@@ -278,9 +278,6 @@ var QfqNS = QfqNS || {}; ...@@ -278,9 +278,6 @@ var QfqNS = QfqNS || {};
n.QfqForm.prototype.handleSaveClick = function () { n.QfqForm.prototype.handleSaveClick = function () {
this.lastButtonPress = "save"; this.lastButtonPress = "save";
n.Log.debug("save click"); n.Log.debug("save click");
// First, remove all validation states, in case a previous submit has set a validation state, thus we're not
// stockpiling them.
this.clearAllValidationStates();
this.submit(); this.submit();
}; };
...@@ -325,6 +322,9 @@ var QfqNS = QfqNS || {}; ...@@ -325,6 +322,9 @@ var QfqNS = QfqNS || {};
alert.show(); alert.show();
return; return;
} }
// First, remove all validation states, in case a previous submit has set a validation state, thus we're not
// stockpiling them.
this.clearAllValidationStates();
this.form.submitTo(this.submitTo); this.form.submitTo(this.submitTo);
}; };
...@@ -658,11 +658,13 @@ var QfqNS = QfqNS || {}; ...@@ -658,11 +658,13 @@ var QfqNS = QfqNS || {};
$formGroup.removeClass("has-warning"); $formGroup.removeClass("has-warning");
$formGroup.removeClass("has-error"); $formGroup.removeClass("has-error");
$formGroup.removeClass("has-success"); $formGroup.removeClass("has-success");
$formGroup.removeClass("has-danger");
}; };
n.QfqForm.prototype.clearAllValidationStates = function () { n.QfqForm.prototype.clearAllValidationStates = function () {
$('.has-warning,.has-error,.has-success').removeClass("has-warning has-error has-success"); $('.has-warning,.has-error,.has-success,.has-danger').removeClass("has-warning has-error has-success" +
" has-danger");
$('[data-qfq=validation-message]').remove(); $('[data-qfq=validation-message]').remove();
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment