I have tried window.confirm on a submit button saying "Are you sure" but even if I click on no it submits itself? Is this the wrong way of using it?
<button type="submit" class="btn btn-primary" onclick="window.confirm('Are you sure you want to transfer to user?')">
Transfer
</button>