top of page

Forum Posts

Victoria Walker
Oct 27, 2019
In Coding with Velo
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."; } } }
0
4
682
Victoria Walker
Oct 27, 2019
In Coding with Velo
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."; } } }
0
1
803

Victoria Walker

More actions
bottom of page