This is a migrated thread and some comments may be shown as answers.

Upload on click dropzone

1 Answer 37 Views
This is a migrated thread and some comments may be shown as answers.
Emanuele
Top achievements
Rank 1
Emanuele asked on 04 Apr 2018, 03:19 PM

Hi,
I wonder if there is any way to include in a dropzone container a functionality of uploading a file
by clicking on it? In other words keep two functionalities in one place.

I'll leave here the dojo sandbox for reference  https://dojo.telerik.com/iFEriwoK

Best regards,

Emanuele

1 Answer, 1 is accepted

Sort by
0
Ivan Danchev
Telerik team
answered on 05 Apr 2018, 06:01 AM
Hi Emanuele,

You can attach a click handler to the span element in the dropzone:
<span style="color: red;" onclick="onClick()">or click here</span>

And in the handler trigger the click event of the Upload's input element:
function onClick() {
  $("#files").click();
}

This way clicking on the span will bring up the Upload's file selection dialog. Updated dojo example.

Regards,
Ivan Danchev
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Asked by
Emanuele
Top achievements
Rank 1
Answers by
Ivan Danchev
Telerik team
Share this question
or