I want to replicate the green plus from the admin site in my own app to add a record to a table. I have it mostly working (using mainly this: Django admin - How can I add the green plus sign for Many-to-many Field in custom admin form), except that instead of a pop-up window, the add page loads in the same window and does not disappear when I click 'save'.
The following html is generated by my app, which appears OK (the onclick bit):
<a href="/admin/pricemanager/item/add/" class="add-another" id="add_id_form-0-item" onclick="return showAddAnotherPopup(this);">
But it appears that some javascript is missing at the top of the page. Am I forgetting to include something in my template?
I have found some related questions such as Django Admin popup functionality, but I don't understand the answers.
How can I make the pop-up work? (I would think that it should not be necessary to write lots of custom javascript - of which I know nothing - to make something work that already works in the admin app)