From 6321b9e02c6c0910d23cfc2df372b6c9a325aae7 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sat, 20 Apr 2019 10:17:05 +0200 Subject: [PATCH] Fix duplicated form fields due to bad selector --- Views/FormView.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Views/FormView.js b/Views/FormView.js index d1d8439..a777873 100644 --- a/Views/FormView.js +++ b/Views/FormView.js @@ -197,9 +197,9 @@ export class FormView { inputs = [].slice.call(form.getElementsByTagName('input')), buttons = form.getElementsByTagName('button'), canvas = form.getElementsByTagName('canvas'), - external = document.querySelectorAll('[form=' + this.id + ']'), + external = document.querySelectorAll('form:not(#' + this.id + ') [form=' + this.id + ']'), special = form.querySelectorAll('[data-name]'), - specialExt = document.querySelectorAll('[data-form=' + this.id + '] [data-name]'), + specialExt = document.querySelectorAll('form:not(#' + this.id + ') [data-form=' + this.id + '] [data-name]'), inputLength = inputs.length; // todo: handle trigger element. check which element triggered the submit and pass it's name+value