Загрузочный экран для формы
<html:
<form action="{% url 'downloadStatusPickingCustomerByCollection' %}" method="POST">{% csrf_token %}
<div class="pnl-collection">
<div>
<div class="tituloPnl">
<h3>Estado Ordenes de Venta por Colección</h3>
</div>
<div class="btnExport">
<button onclick="loadDisplay()" class="btn btn-light" type="submit">Exportar</button>
</div>
</div>
<div class="filtro">
<div>
<div class="title-select"><span>Colección</span></div>
</div>
<div>
<select class="form-select form-select-sm form-down-report" name="collection-StatusCustomer-name" id="" required>
<option value="">- SELECCIONE COLECCIÓN -</option>
{% if collections %}
{% for collection in collections%}
<option value="{{collection.Name}}">{{collection.Name}}</option>
{% endfor %}
{% endif %}
</select>
</div>
</div>
</div>
</form>
javascript:
function loadDisplay() {
if (document.querySelector(".form-down-report").value != "") {
document.getElementById("preloader-camion").style.display = 'block';
jquery(window).load(
function () {
document.getElementById("preloader-camion").style.display = 'none';
});
}
}
У меня есть bakcend, разработанный на django, поэтому в маршруте формы вы можете увидеть django "url tag".