Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Before Delete - Are you sure?

Questions related to customising nuBuilder Forte with JavaScript or PHP.
Post Reply
fpdragon
Posts: 38
Joined: Wed May 29, 2019 2:50 pm

Before Delete - Are you sure?

Unread post 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.
kev1n
nuBuilder Team
Posts: 4416
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 74 times
Been thanked: 472 times
Contact:

Re: Before Delete - Are you sure?

Unread post by kev1n »

There's already a js popup "Delete This Record?" I don't really understand what you want.
fpdragon
Posts: 38
Joined: Wed May 29, 2019 2:50 pm

Re: Before Delete - Are you sure?

Unread post 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
kev1n
nuBuilder Team
Posts: 4416
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 74 times
Been thanked: 472 times
Contact:

Re: Before Delete - Are you sure?

Unread post by kev1n »

Maybe like this:

Code: Select all

function nuBeforeDelete(){

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

}


fpdragon
Posts: 38
Joined: Wed May 29, 2019 2:50 pm

Re: Before Delete - Are you sure?

Unread post 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?
kev1n
nuBuilder Team
Posts: 4416
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 74 times
Been thanked: 472 times
Contact:

Re: Before Delete - Are you sure?

Unread post by kev1n »

Options Menu -> Form Properties (Ctrl + Shift + F) -> Custom Code
fpdragon
Posts: 38
Joined: Wed May 29, 2019 2:50 pm

Re: Before Delete - Are you sure?

Unread post 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.
kev1n
nuBuilder Team
Posts: 4416
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 74 times
Been thanked: 472 times
Contact:

Re: Before Delete - Are you sure?

Unread post 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
Post Reply