Commit 3cb172f6 authored by bbaer's avatar bbaer
Browse files

Finds error messages outside of input-group if input-group is used.

parent f0143573
......@@ -44,11 +44,7 @@ QfqNS.Element = QfqNS.Element || {};
this.$formGroup = this.$findFormGroup($enclosedElement);
this.$element = this.$formGroup.find(elementSelector);
this.$label = this.$formGroup.find('.control-label');
if (this.$formGroup.hasClass(".input-group")) {
this.$helpBlock = this.$formGroup.parent().find(".help-block");
} else {
this.$helpBlock = this.$formGroup.find(".help-block");
}
this.$helpBlock = this.$formGroup.find(".help-block");
};
/**
......@@ -103,7 +99,11 @@ QfqNS.Element = QfqNS.Element || {};
}
if ($formGroup.length > 1) {
throw new Error("enclosed element yields ambiguous form group");
$formGroup = $('#' + $enclosedElement.attr('id') + '-r');
console.log("Enclosed Element Id: " + $enclosedElement.attr('id'));
if ($formGroup.length !== 1) {
throw new Error("enclosed element yields ambiguous form group");
}
}
return $formGroup;
......
......@@ -293,9 +293,15 @@ var QfqNS = QfqNS || {};
n.QfqForm.prototype.validationError = function (info) {
var $formControl = $(info.data.element);
var $messageContainer = $formControl.siblings('.hidden.with-errors');
if ($messageContainer.length === 0) {
if ($formControl.parent().hasClass('input-group')) {
$messageContainer = $formControl.parent().siblings('.hidden.with-errors');
}
}
$messageContainer.data('qfq.hidden.message', true);
$messageContainer.removeClass('hidden');
};
n.QfqForm.prototype.validationSuccess = function (info) {
......@@ -772,7 +778,6 @@ var QfqNS = QfqNS || {};
if (this.formImmutableDueToConcurrentAccess) {
return;
}
console.log("QFQForm Changehandler");
this.getSaveButton().removeClass("disabled");
this.getSaveButton().addClass(this.getSaveButtonAttentionClass());
this.getSaveButton().removeAttr("disabled");
......
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