diff --git a/UI/Component/Form.js b/UI/Component/Form.js index 345ab7e..3783c14 100644 --- a/UI/Component/Form.js +++ b/UI/Component/Form.js @@ -213,8 +213,7 @@ export class Form const self = this; imageUpload.addEventListener('change', function () { - const formElement = document.getElementById(id); - const preview = formElement.querySelector('img#preview-' + imageUpload.getAttribute('name')); + const preview = document.querySelector('#preview-' + imageUpload.getAttribute('name')); preview.src = window.URL.createObjectURL(imageUpload.files[0]); preview.onload = function () {