add pop up

This commit is contained in:
Cayo Puigdefabregas 2023-01-17 13:07:01 +01:00
parent a572ef0507
commit f8d418b4a9
1 changed files with 9 additions and 3 deletions

View File

@ -40,7 +40,7 @@
<h5 class="card-title">Change Snapshot Type Upload</h5>
<div class="list-group col-6">
<div class="list-group-item">
<form method="post" class="row g-3 needs-validation">
<form method="post" class="row g-3 needs-validation" id="form_change_updated">
{{ form.csrf_token }}
{% for f in form %}
{% if f != form.csrf_token %}
@ -114,7 +114,7 @@
<div class="modal-footer">
<button type="button" class="btn btn-secondary-outline" data-bs-dismiss="modal">Cancel</button>
<a href="javascript:void()" type="button" class="btn btn-danger">
<a href="javascript:send_form_change_updated()" type="button" class="btn btn-danger">
Confirm Save!
</a>
</div>
@ -124,12 +124,18 @@
</div>
<script>
function change_updated() {
const stype = $("#snapshot_type").val();
$("#update").attr('class', 'd-none');
$("#new_device").attr('class', 'd-none');
const stype = $("#snapshot_type").val();
$("#"+stype).attr('class', 'd-block');
$("#activeChangeUpdatedModal").click();
}
function send_form_change_updated() {
$("#form_change_updated").trigger('submit');
}
</script>
{% endblock main %}