I need to allow customers to upload recipe pictures on a payment form. I have used 4 upload buttons, a text field, and a normal button. Using an event function, and the below code - but still isn't working. The upload button works, the text field doesn't update, and the normal button doesn't upload the image. My coding is pretty limited - so help welcome! Code at present as follows:
export function button_click(event) {
for (var x = 0; x < 6 ; x++){
if($w("#uploadButton"+x).value.length > 0) {
$w("#text67").text = `Uploading ${$w("#uploadButton"+x).value[0].name}`;
$w("#uploadButton"+x).startUpload()
.then( (uploadedFile) => {
$w("#text67").text = "Upload successful";
})
.catch( (uploadError) => {
$w("#text67").text = "File upload error";
console.log(`Error: ${uploadError.errorCode}`);
console.log(uploadError.errorDescription);
});
}
else {
$w("#text67").text = "Please choose a pic to upload.";
}
}
}
Replied in this thread: https://www.wix.com/corvid/forum/community-discussion/uploading-multiple-images-1