# Popup not popping (!?)

**URL:** <https://forum.djangoproject.com/t/popup-not-popping/16956>\
**Category:** Templates & Frontend\
**Created:** [November 11, 2022, 6:59pm UTC](https://forum.djangoproject.com/t/popup-not-popping/16956 "2022-11-11T18:59:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![obarbachan](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/obarbachan/32/10603_2.png) [@obarbachan](https://forum.djangoproject.com/u/obarbachan)\
**Post date:** [November 11, 2022, 6:59pm UTC](https://forum.djangoproject.com/t/popup-not-popping/16956/1 "2022-11-11T18:59:35Z")

</div>

Hello!

I’m trying to set a popup modal through a view, but when I click the button that calls the view I’m being redirected to another page with the HTML of the popup.

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [November 11, 2022, 7:18pm UTC](https://forum.djangoproject.com/t/popup-not-popping/16956/2 "2022-11-11T19:18:02Z")

</div>

You need to use some sort of JavaScript in the browser to do modals. If the modal is being rendered server-side, then you would make an AJAX call to the view to retrieve the html div with the modal, and then present it in the browser. The server cannot perform in-page element replacement directly.

---

<div class="post-metadata">

**Author:** ![obarbachan](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/obarbachan/32/10603_2.png) [@obarbachan](https://forum.djangoproject.com/u/obarbachan)\
**Post date:** [November 11, 2022, 7:45pm UTC](https://forum.djangoproject.com/t/popup-not-popping/16956/3 "2022-11-11T19:45:22Z")

</div>

That was it! Thank you!
