Commit 5816533c authored by Rafael Ostertag's avatar Rafael Ostertag
Browse files

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

parent 80e833be
......@@ -278,9 +278,6 @@ var QfqNS = QfqNS || {};
n.QfqForm.prototype.handleSaveClick = function () {
this.lastButtonPress = "save";
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();
};
......@@ -325,6 +322,9 @@ var QfqNS = QfqNS || {};
alert.show();
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);
};
......@@ -658,11 +658,13 @@ var QfqNS = QfqNS || {};
$formGroup.removeClass("has-warning");
$formGroup.removeClass("has-error");
$formGroup.removeClass("has-success");
$formGroup.removeClass("has-danger");
};
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();
};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment