diff --git a/opentech/static_src/src/javascript/main.js b/opentech/static_src/src/javascript/main.js index 6ce41abd74d961d09da320c121eb662944256930..86d1def8a8eb68cd0f31b513ae6aee4021620d45 100755 --- a/opentech/static_src/src/javascript/main.js +++ b/opentech/static_src/src/javascript/main.js @@ -21,9 +21,11 @@ $(function () { // Show list of selected files for upload on input[type=file] $('input[type=file]').change(function() { + // remove any existing files first + $(this).siblings('.form__file').remove(); for (let i = 0; i < $(this)[0].files.length; ++i) { $(this).parents('.form__item').prepend(` - <p>${$(this)[0].files[i].name}</p> + <p class="form__file">${$(this)[0].files[i].name}</p> `); } });