Hi Terry,
first I wish you and all of the members of the group a Happy New Year. I am so grateful to receive help from this group. This is my code I used, but
next to the form field “Choose file”, or in
German “Durchsuchen”, a note normally appears directly next to the form
field “Choose file” that no file has yet been selected (“no file
chosen”). Once the file has been selected, the name of the file appears
next to the “Choose file” form field. Is it possible to adapt the form
and the JavaScript accordingly? Here is the code:
<form action="generate_invoices.php" method="post" enctype="multipart/form-data">
<label for="excelFile">Wähle eine Excel-Datei:</label>
<input type="file" name="excelFile" id="excelFile" style="display:none;" accept=".xlsx, .xls">
<button type="button" id="upload-button">Durchsuchen</button>
<input type="submit" value="Hochladen und Verarbeiten">
</form>
<script>
document.getElementById('upload-button').addEventListener('click', function() {
document.getElementById('excelFile').click();
});
</script>
Thanks a lot for helping.
Heinz