I'm trying to do this with JQuery. Below is my code. I have a form, with the id "delete". I would like a dialog to appear when a person hits the delete button confirming if this is what they would like to do. If they confirm, the default action happens, if they say no or x out of the dialog, i would like nothing to happen. Right now it the dialog box doesn't appear at all. Have any ideas?
<form action="/delete/{{card.id}}" method="POST" id="delete">
<button type="submit" class="btn pull-right">
<p><span class="glyphicon glyphicon-remove"></span></p>
</button>
</form>
<form action="/edit/{{card.id}}" method="POST">
<button type="submit" class="btn pull-right">
<p><span class="glyphicon glyphicon-pencil"></span></p>
</button>
</form>
</div>
<hr>
{{card.content}}
</div>
{% endfor %}
{% endblock %}
{% block script %}
$("#delete").submit(function() {
return var confirm = confirm("Are you sure you want to delete?");
});
{% endblock %}