I have a problem with Javascript: it fires two events simultaneously for a DropZone ---- Part 2

Coreysan 1,586 Reputation points
2023-01-23T19:17:49.49+00:00

AgaveJoe - you answered this question but when I read it, I clicked on something and the answer

completely disappeared!!! Its gone. Poof!!

What the what?

Can you send the answer again - it had something to do with stopping propagation.

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,012 questions
{count} votes

Accepted answer
  1. AgaveJoe 25,761 Reputation points
    2023-01-23T20:13:21.81+00:00
    <div id="outerElement">
        <input type="file" name="myname1" class="dz_input1" id="input1" />
        <div class="overlay">
            <a href="#" class="icon" title="Remove Picture" onclick="RemovePicture(event)">
                <i class="fa fa-user"></i>
            </a>
        </div>
    </div>
    
    @section scripts {
    <script>
        $('#outerElement').click(function () {
            console.log('outerElement click event fired')
        });
    
    
        function RemovePicture(event) {
            event.stopPropagation();
            console.log('RemovePicture click event fired');
        }
    </script>
    }
    
    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful