Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Warning Message - "Delete this row?" before deletion occurs.

Avatar

Level 9

I'm trying to find a way to warn the user that the button they clicked will delete the entire row. If they answer "Yes" to continue the deletion occurs. If they answer "No", the row does not delete.

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

If you declare a variable to the value of the reponse from a dialog, then you can test that response and take action:

// Prompt the user

var nResponse = xfa.host.messageBox("You are about to delete this row. \n\nDo you want to continue?", "Deleting a row", 2, 2)

// Test the response: Yes = 4

if (nResponse == 4) {

     // You deletion script

}

Hope that helps,

Niall

View solution in original post

7 Replies

Avatar

Correct answer by
Level 10

Hi,

If you declare a variable to the value of the reponse from a dialog, then you can test that response and take action:

// Prompt the user

var nResponse = xfa.host.messageBox("You are about to delete this row. \n\nDo you want to continue?", "Deleting a row", 2, 2)

// Test the response: Yes = 4

if (nResponse == 4) {

     // You deletion script

}

Hope that helps,

Niall

Avatar

Level 9

Place this code iin the Click event of the deletion button?

Thank you

Avatar

Level 10

Yes, that's correct. You just need to insert your existing deletion script within the if statement.

Niall

Avatar

Level 9

Yes! Thank you so much! That is exactly what I needed.

Thanks Niall

Avatar

Level 9

Is there a way to make the font size larger (it is a little small).

Thanks again for your help.

-Don

Avatar

Level 10

Hi Don

No, the font size is OS dependant. Each user may be able to amend it on their computer, but it is separate from LC Designer.

You could develop your own dialog, using Acrobat SDK methods or a very handy AcroDialog Acrobat plugin from Windjack Solutions. This will allow you to bold some/all of the text. However you will still be caught on font size.

Good luck,

Niall

Avatar

Level 9

Thanks Niall. At least now I know to stop trying to figure it out!

Thanks for the reply,

-Don