JavaScript customizations in the admin

    Changed in Django 4.1:

    In your custom template, extend the admin_change_form_document_ready block and add the event listener code:

    Two points to keep in mind:

    You could check for the presence of event.detail.formsetName and fall back to the old listener signature as follows: