Signed-off-by: Avior <florian.bouillon@delta-wings.net>
This commit is contained in:
Florian Bouillon 2019-12-02 17:23:49 +01:00
parent fdf5c9a725
commit ee8c4654e7
No known key found for this signature in database
GPG Key ID: B143FF27EF555D16

View File

@ -96,7 +96,12 @@ export default class FormManager {
*/
public setupInputs() {
this.inputs = {};
(this.form.querySelectorAll("[name]:not([data-name])") as NodeListOf<HTMLElement>).forEach((element: HTMLElement) => {
let request = this.form.querySelectorAll("[name]:not([data-name])");
if (this.form.hasAttribute("id")) {
const formID = this.form.getAttribute("id")
request = document.querySelectorAll(`[form="${formID}"][name]:not([data-name]), form#${formID} [name]:not([data-name])`)
}
(request as NodeListOf<HTMLElement>).forEach((element: HTMLElement) => {
let el = this.getInit(element)
if (el) this.inputs[el.getName()] = el
});