Commit dc1410b7 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Revert to an old state of QfqForm.js: 6ee8e007

parent 5b063845
Pipeline #2756 passed with stages
in 4 minutes and 30 seconds
......@@ -523,7 +523,7 @@ var QfqNS = QfqNS || {};
if (data.status === "error") {
this._createError("Error while updating form:<br>" +
(data.message ? data.message : "No reason given"));
(data.message ? data.message : "No reason given"));
return;
}
......@@ -619,23 +619,6 @@ var QfqNS = QfqNS || {};
if (tabId) {
this.bsTabs.activateTab(tabId);
}
var form = document.getElementById(this.form.formId);
var inputs = form.elements;
for (var i = 0; i < inputs.length; i++) {
var e = inputs[i];
if(!e.willValidate) {
continue;
}
if(!e.checkValidity()) {
var updateTabId = this.bsTabs.getContainingTabIdForFormControl(e.getAttribute('name'));
if(updateTabId != tabId) {
this.bsTabs.addDot(updateTabId);
}
}
}
}
// Since we might have switched the tab, re-validate to highlight errors
......@@ -646,12 +629,6 @@ var QfqNS = QfqNS || {};
alert.timeout = 3000;
alert.show();
this.form.$form.each(function() {
if (!$(this).validate) {
}
});
if (!this.skipRequiredCheck) {
return;
}
......@@ -663,6 +640,7 @@ var QfqNS = QfqNS || {};
this.clearAllValidationStates();
}
submitReason = {
"submit_reason": this.lastButtonPress === "close" ? "save,close" : this.lastButtonPress
};
......@@ -1122,7 +1100,6 @@ var QfqNS = QfqNS || {};
};
n.QfqForm.prototype.getFormGroupByControlName = function (formControlName) {
console.log("Form Control Name: " + formControlName);
var $formControl = $("[name='" + formControlName + "']");
if ($formControl.length === 0) {
n.Log.debug("QfqForm.setValidationState(): unable to find form control with name '" + formControlName + "'");
......@@ -1146,13 +1123,12 @@ var QfqNS = QfqNS || {};
var $formGroup = this.getFormGroupByControlName(formControlName);
if ($formGroup) {
$formGroup.addClass("has-" + state);
$formGroup.addClass("testitest");
}
};
n.QfqForm.prototype.resetValidationState = function (formControlName) {
var $formGroup = this.getFormGroupByControlName(formControlName).find('input');
$formGroup.removeClass("has-danger");
var $formGroup = this.getFormGroupByControlName(formControlName);
$formGroup.removeClass("has-warning");
$formGroup.removeClass("has-error");
$formGroup.removeClass("has-success");
$formGroup.removeClass("has-danger");
......@@ -1345,4 +1321,4 @@ var QfqNS = QfqNS || {};
window.history.back();
};
})(QfqNS);
\ No newline at end of file
})(QfqNS);
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