mirror of
https://github.com/dzeiocom/FormManager.git
synced 2025-04-23 19:32:14 +00:00
parent
fdf5c9a725
commit
ee8c4654e7
@ -96,7 +96,12 @@ export default class FormManager {
|
|||||||
*/
|
*/
|
||||||
public setupInputs() {
|
public setupInputs() {
|
||||||
this.inputs = {};
|
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)
|
let el = this.getInit(element)
|
||||||
if (el) this.inputs[el.getName()] = el
|
if (el) this.inputs[el.getName()] = el
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user