I am looking to create a confirmation popup window whenever the delete button is clicked. It currently is functional and immediately deletes. Here is some of my code: views.py:
class patientDelete(LoginRequiredMixin, DeleteView):
model = patient
success_url = reverse_lazy('patients:index')
index.html
<form action="{% url 'patients:patient-delete' patient.id %}" method="post" style="display: inline;">
{% csrf_token %}
<input type="hidden" name="patient_id" value="{{ patient.id }}" />
<button type="submit" class="btn btn-default btn-sm">
<span class="glyphicon glyphicon-trash"></span>
</button>
</form>
and my urls.py
# /patients/patient/pk/delete
url(r'patient/(?P<pk>[0-9]+)/delete/$', views.patientDelete.as_view(), name='patient-delete'),
I have searched left, right and center and dont really understand most of it. I have been using a lot of tutorials to help me here and am quite new to django. Thanks for your help in advance!