add file uploads
This commit is contained in:
parent
93027bfd09
commit
2c480909ee
6 changed files with 42 additions and 7 deletions
|
@ -5,9 +5,10 @@ async function formClick(ev) {
|
|||
|
||||
let fData = new FormData(target);
|
||||
|
||||
let file = target.querySelector('input[type=file]');
|
||||
if (file)
|
||||
for (let file of target.querySelectorAll('.form-input')) {
|
||||
file.value = null;
|
||||
file.textContent = '';
|
||||
}
|
||||
|
||||
let fetched = await fetch(target.action, {
|
||||
'method': 'POST',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue