Welcome! Log In Create A New Profile

Advanced

WebDev 23 - Multiple Drag en Drop Upload Controls

Posted by dlauwers 
WebDev 23 - Multiple Drag en Drop Upload Controls
January 24, 2019 05:44PM
Hi,

I created a Control Template where I encorperated the functionality of dropping a file on an icon (it uses the upload control HTML 5). This file is then uploaded to the database with parameters I supply on the Control Template init function when the page is started.This way if I needed to upload a document to some record, I drop in the Control Template, set some init parameters and done.

All works well as I wanted, but when I please 3 Control Templates on a page (in different tabs, cells,..) when I drop a file on 1 of those controls, they all get the drop event, and all upload the same file moody smiley

Is there a way to stop the multiplication of the drop event ? I saw some Java code to stop propagation

e.preventDefault();
e.stopPropagation();

But that does not work, or is in the wrong place in the code.

Does anybody know a solution for this ? Is it because it is inside a Control Template ?

Thanks
Danny
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: