Text element not showing coded text

Hello all,

I modified some code to help with a submit button on an upload form and the portion of code that is supposed to display messages in the textbox as to the status of the upload doesn’t seem to work. Instead of showing the relevant message based on the status of the upload procedure, it just displays the default text. See below code from my page:

export function button12_click(event) {
if ($w(‘#uploadButton1’).value.length > 0) {
$w(‘#text22’).text = Uploading ${$w('#uploadButton1').value[0].name};
$w(‘#uploadButton1’).startUpload()
.then( (uploadedFile) => {
$w(‘#text22’).text = “Upload successful”;
})
. catch ( (uploadError) => {
$w(‘#text22’).text = “File upload error”;
console.log(Error: ${uploadError.errorCode});
console.log(uploadError.errorDescription);
});
}
else {
$w(‘#text22’).text = “Please choose a file to upload.”;
}
}

I’m not getting any errors here or in the console when I run the page.

Any suggestions?

So…can anyone help with this? It’s pretty annoying.

Is anyone available to help with this? I’m still having this problem and I don’t see where there are any errors in the code.

I’ve tried checking to see if there’s an issue with the order of the event in the exiting functions but I don’t see anything to suggest that this wouldn’t work.