Category : javascript

I have a problem with getting data from the tag on the page with the Django form. templates: <form method="post" enctype="multipart/form-data"> {% csrf_token %} <input id="result" type="hidden"> <script type="text/javascript"> const upload = document.querySelector(‘#inputGroupFile01’); const result = document.querySelector(‘#result’); upload.addEventListener("change", (e) => { previewFunc(e.target.files[0]); }); function previewFunc(file) { if (!file.type.match(/image.*/)) return false; const reader = new FileReader(); ..

Read more