Commit f0c9e1b4 authored by Rafael Ostertag's avatar Rafael Ostertag
Browse files

Fixed issue, that upon save button press, invalid fields are not highlighted.

parent 33de2ee1
......@@ -102,29 +102,7 @@ var QfqNS = QfqNS || {};
// return true;
//}
if (document.forms[this.formId].checkValidity()) {
return true;
}
var formElements = document.forms[this.formId];
var formElementsLength = formElements.length;
var invalidElements = [];
for (var i = 0; i < formElementsLength; i++) {
var formElement = formElements[i];
if (!formElement.willValidate) {
continue;
}
if (!formElement.checkValidity()) {
invalidElements.push(formElement);
}
}
return invalidElements.length === 0 ? true : invalidElements;
return document.forms[this.formId].checkValidity();
};
})(QfqNS);
......@@ -189,7 +189,7 @@ var QfqNS = QfqNS || {};
n.QfqForm.prototype.submit = function () {
if (this.form.validate() !== true) {
this.form.$form.validator();
this.form.$form.validator('validate');
var alert = new n.Alert("Form is incomplete.", "warning");
alert.show();
return;
......
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