How to add a confirmation popup dialog when saving an object in Django admin?

65 views Asked by At

I have a model with name and email as fields. I want to show a warning popup to the user if there is already an entry with the same name. The user is allowed to create the entry once they acknowledge the warning.

I'm looking to implement two specific features in this Django admin interface:

  1. Conditional Confirmation Pop-up: I want to display a confirmation pop-up dialog before saving data, but I want it to appear based on a specific condition. This condition is determined by user input.

  2. Confirmation for Data Saving: After clicking the 'Save' button, I want to see a confirmation dialog. Data should only be saved if the user confirms the action.

I've attempted to use messages to achieve this, but I couldn't find a way to display a warning or error message before saving the data.

0

There are 0 answers