12
Views
4
Comments
Solved
How to disable upload widget in reactive?
Question
Application Type
Reactive

Hello,

Since the upload widget doesn't have a disable property, so I tried using Javascript.

document.getElementById($parameters.InputFileId).disabled = true;

But it isn't working. Do you have any solution to this?

Cheers!

mvp_badge
MVP
Rank: #78
Solution

Hi Esrom,

For the specified use-case, try with the below-mentioned JavaScript code.

  • Define a  JavaScript node with a single input parameter passing the Upload widget Id
  • Using the JavaScript disable the "file" type input which is defined inside the upload widget

JavaScript Snippet

var uploadWidget = document.querySelector('#' + $parameters.UploadWidgetId + ' > input');
uploadWidget.setAttribute("disabled", "disabled");


Hope this helps you!


Kind regards,

Benjith Sam

Rank: #68

Hi Esrom,

I suggest using this component for File Upload.

https://www.outsystems.com/forge/component-overview/7405/reactfilepondupload

mvp_badge
MVP
Rank: #78
Solution

Hi Esrom,

For the specified use-case, try with the below-mentioned JavaScript code.

  • Define a  JavaScript node with a single input parameter passing the Upload widget Id
  • Using the JavaScript disable the "file" type input which is defined inside the upload widget

JavaScript Snippet

var uploadWidget = document.querySelector('#' + $parameters.UploadWidgetId + ' > input');
uploadWidget.setAttribute("disabled", "disabled");


Hope this helps you!


Kind regards,

Benjith Sam