fix more js in submit

remotes/1693045480750635534/spooky-22
atrc445 2021-09-26 17:25:07 +02:00
parent 0d707be234
commit 78887b4531
1 changed files with 5 additions and 5 deletions

View File

@ -425,20 +425,20 @@
if (filename.endsWith(".jpg") || filename.endsWith(".jpeg") || filename.endsWith(".png") || filename.endsWith(".webp"))
{
f.files = files;
document.getElementById('filename-show').text(filename);
document.getElementById('urlblock').addClass('d-none');
document.getElementById('filename-show').textContent = filename;
document.getElementById('urlblock').classList.add('d-none');
var fileReader = new FileReader();
fileReader.readAsDataURL(f.files[0]);
fileReader.addEventListener("load", function () {document.getElementById('image-preview').attr('src', this.result);});
document.getElementById('file-upload').attr('required', false);
document.getElementById('file-upload').setAttribute('required', 'false');
checkForRequired();
}
}
document.getElementById('file-upload').addEventListener('change', function(e){
f=document.getElementById('file-upload');
document.getElementById('urlblock').addClass('d-none');
document.getElementById('filename-show').text(document.getElementById('file-upload')[0].files[0].name);
document.getElementById('urlblock').classList.add('d-none');
document.getElementById('filename-show').textContent = document.getElementById('file-upload')[0].files[0].name;
var fileReader = new FileReader();
fileReader.readAsDataURL(f.files[0]);
fileReader.addEventListener("load", function () {document.getElementById('image-preview').attr('src', this.result);});