diff --git a/lib/WebGUI/Form/File.pm b/lib/WebGUI/Form/File.pm index 7a860e808..e77d6a09d 100644 --- a/lib/WebGUI/Form/File.pm +++ b/lib/WebGUI/Form/File.pm @@ -293,7 +293,10 @@ sub toHtml { my @files = @{ $storage->getFiles } if (defined $storage); my $maxFiles = $self->get('maxAttachments') - scalar(@files); if ($maxFiles > 0) { - $uploadControl = '' diff --git a/www/extras/FileUploadControl.js b/www/extras/FileUploadControl.js index 687254f73..38de29af4 100644 --- a/www/extras/FileUploadControl.js +++ b/www/extras/FileUploadControl.js @@ -4,6 +4,11 @@ function FileUploadControl(fieldName, imageArray, removeLabel, fileLimit, size) { + + // Remove the existing field + var replace = document.getElementById( fieldName ); + replace.parentNode.removeChild( replace ); + this.images = imageArray; this.fileLimit = fileLimit; this.fileCount = 1;