# Action link confirmation dialog

**URL:** <https://forums.knack.com/t/action-link-confirmation-dialog/15072>\
**Category:** Get Answers\
**Created:** [October 30, 2023, 4:59pm UTC](https://forums.knack.com/t/action-link-confirmation-dialog/15072 "2023-10-30T16:59:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marcin](https://avatars.discourse-cdn.com/v4/letter/m/958977/32.png) [@Marcin](https://forums.knack.com/u/Marcin)\
**Post date:** [October 30, 2023, 4:59pm UTC](https://forums.knack.com/t/action-link-confirmation-dialog/15072/1 "2023-10-30T16:59:05Z")

</div>

Hi Guys  
I’m trying to add a confirmation dialog to a Action link. Simple “Are you sure”. I have tried with this

```auto
(document).on('knack-view-render.view_407', function(event, view, record) {

    $('.col-15 a').each(function(){
      $(this).on('click', function (event) {
        if (confirm('Delete selected item?')){
          return true;
          } else {
            event.preventDefault();
          };
      });
    });
});

```

I have also tried a couple other methods, but it is always works the same. Dialog box will apear and it doesn’t matter if I’ll confirm or Cancel, the action is executing anyway (Soft delete in my case). Can you help me with this?

---

<div class="post-metadata">

**Author:** ![Marcin](https://avatars.discourse-cdn.com/v4/letter/m/958977/32.png) [@Marcin](https://forums.knack.com/u/Marcin)\
**Post date:** [October 30, 2023, 5:56pm UTC](https://forums.knack.com/t/action-link-confirmation-dialog/15072/2 "2023-10-30T17:56:43Z")

</div>

I’ve solved a problem. It is working with this code:

```auto
    $('.col-15 a span').each(function(){
      $(this).on('click', function (event) {
        if (confirm('Delete selected item?')){
          return true;
          } else {
            event.preventDefault();
            event.stopPropagation();
          };
      });
    });

```
