Page 1 of 1

Before Delete - Are you sure?

Posted: Mon Sep 16, 2019 11:52 am
by fpdragon
Hello,

Is there a possibility to ask a user if she or he is sure to delete the current item?
I know the BD Before Delete PHP config but isn't it that I want to ask and stop the delete process on JavaScript level before it goes on on php level on the server?

Thanks.

Re: Before Delete - Are you sure?

Posted: Mon Sep 16, 2019 12:43 pm
by kev1n
There's already a js popup "Delete This Record?" I don't really understand what you want.

Re: Before Delete - Are you sure?

Posted: Mon Sep 16, 2019 1:08 pm
by fpdragon
kev1n wrote:There's already a js popup "Delete This Record?" I don't really understand what you want.
Sorry for being unclear. My mistake.

I want to add my own message with a specific text that clarifies what exactly is deleted by continuing.

Background infos:
I'm using iFrames with showing subelements in the edit view of a main element. That works very well but some users are confused that there are two Save Delete and Clone Buttons (one time for the main item itself in the upper left corner and one time in the iframe for the subelements). And now it happened that a user wanted to delete a subelement and accidentally removed the whole main element and we lost data due to this.
So I thought I add a more eyecatching text with "Are you really 100% totally sure to delete the MAIN element and not the tiny little sub element?". With many ??? and !!! and other eyecatching characters xD.

Hope this clarifies my intention.

thx

Re: Before Delete - Are you sure?

Posted: Mon Sep 16, 2019 3:38 pm
by kev1n
Maybe like this:

Code: Select all

function nuBeforeDelete(){

    return confirm('Do you really want to delete?')

}



Re: Before Delete - Are you sure?

Posted: Wed Sep 18, 2019 10:59 am
by fpdragon
kev1n wrote:Maybe like this:

Code: Select all

function nuBeforeDelete(){

    return confirm('Do you really want to delete?')

}


Where do I have to enter this code?

Re: Before Delete - Are you sure?

Posted: Wed Sep 18, 2019 12:31 pm
by kev1n
Options Menu -> Form Properties (Ctrl + Shift + F) -> Custom Code

Re: Before Delete - Are you sure?

Posted: Wed Sep 18, 2019 1:04 pm
by fpdragon
kev1n wrote:Options Menu -> Form Properties (Ctrl + Shift + F) -> Custom Code
So you mean the "javascript" field and overload the function nuBeforeDelete()

That's not working for me.

Re: Before Delete - Are you sure?

Posted: Wed Sep 18, 2019 7:28 pm
by kev1n
fpdragon wrote:
kev1n wrote:Options Menu -> Form Properties (Ctrl + Shift + F) -> Custom Code
So you mean the "javascript" field and overload the function nuBeforeDelete()

That's not working for me.
Like this:
https://streamable.com/rt1mk