Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug when trying to change the dz-message text #2291

Open
s4Dt0y opened this issue Apr 25, 2024 · 0 comments
Open

Bug when trying to change the dz-message text #2291

s4Dt0y opened this issue Apr 25, 2024 · 0 comments

Comments

@s4Dt0y
Copy link

s4Dt0y commented Apr 25, 2024

When I change the dz-message like <div class="dz-message">, I can no longer click to upload or even drag a file in. In fact, even after I remove the div anchor that changes the dz-message, the dropzone does not reset. It just has no text and no functionality. Is there something I am doing wrong? Here is the div tag and script that deals with the dropzone. (btw, I am using flask, so there is a little bit of jinja templating in it.

{% extends "base.html" %}

{% block title %}Upload{% endblock %}


{% block content %}

<div class="padding_left">
    <form
        method="POST"
        class="dropzone dz-clickable me-3"
        action="{{ url_for('upload.upload') }}"
        id="dropper"
        enctype="multipart/form-data"
    >
    </form>
    <div class="text-center">
        <button id="submit-all" class="btn btn-dark mt-3">Upload Files</button>
    </div>

    <script type="application/javascript">
        Dropzone.options.dropper = {
            paramName: "file",
            chunking: true,
            forceChunking: true,
            autoProcessQueue: false,
            url: "{{ url_for('upload.upload') }}",
            maxFilesize: 1025, // megabytes
            chunkSize: 1000000, // bytes
            init: function() {
                let submitButton = document.querySelector("#submit-all");
                let myDropzone = this;

                submitButton.addEventListener("click", function() {
                    myDropzone.processQueue();
                });
            }
        }

    </script>
</div>

{% endblock %}
@s4Dt0y s4Dt0y changed the title Cannot change the dz-message text Bug when trying to change the dz-message text Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant