# Focus Item Form Modal Popup not Closing after Form Submission

**URL:** <https://forum.mautic.org/t/focus-item-form-modal-popup-not-closing-after-form-submission/8900>\
**Category:** Product Support\
**Created:** [July 6, 2017, 4:30am UTC](https://forum.mautic.org/t/focus-item-form-modal-popup-not-closing-after-form-submission/8900 "2017-07-06T04:30:08Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![archit](https://avatars.discourse-cdn.com/v4/letter/a/57b2e6/32.png) [@archit](https://forum.mautic.org/u/archit)\
**Post date:** [July 6, 2017, 4:30am UTC](https://forum.mautic.org/t/focus-item-form-modal-popup-not-closing-after-form-submission/8900/1 "2017-07-06T04:30:08Z")

</div>

Hello,  
  
  
  
I am facing an issue. When i am display a form using focus item in my website after form gets submit, the redirection is done in modal popup iteself and its not getting closed and then redirecting. Can anyone please help me resolve this.

---

<div class="post-metadata">

**Author:** ![archit](https://avatars.discourse-cdn.com/v4/letter/a/57b2e6/32.png) [@archit](https://forum.mautic.org/u/archit)\
**Post date:** [July 6, 2017, 4:30am UTC](https://forum.mautic.org/t/focus-item-form-modal-popup-not-closing-after-form-submission/8900/2 "2017-07-06T04:30:08Z")

</div>

Hello,

I am facing an issue. When i am display a form using focus item in my website after form gets submit, the redirection is done in modal popup iteself and its not getting closed and then redirecting. Can anyone please help me resolve this.

---

<div class="post-metadata">

**Author:** ![archit](https://avatars.discourse-cdn.com/v4/letter/a/57b2e6/32.png) [@archit](https://forum.mautic.org/u/archit)\
**Post date:** [July 6, 2017, 9:24am UTC](https://forum.mautic.org/t/focus-item-form-modal-popup-not-closing-after-form-submission/8900/3 "2017-07-06T09:24:13Z")

</div>

Found the solution to this. I am not sure if you consider this a hack, but this worked for me.

In mautic-form-src.js & mautic-form.js files there is a code that is missing to close the modal.

Find “// Register a callback for a redirect” in mautic-form-src.js  
// Register a callback for a redirect  
if (response.redirect) {  
Modal.close(); \<---- Line Added  
setTimeout(function () {  
window.location = response.redirect;  
}, 2000);  
}  
} else if (response.redirect) {  
Modal.close(); \<---- Line Added  
window.location = response.redirect;

Similarly find it also in mautic-form.js and added the following code

---

<div class="post-metadata">

**Author:** ![stromdh](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/stromdh/32/690_2.png) [@stromdh](https://forum.mautic.org/u/stromdh)\
**Post date:** [January 22, 2020, 2:31pm UTC](https://forum.mautic.org/t/focus-item-form-modal-popup-not-closing-after-form-submission/8900/4 "2020-01-22T14:31:04Z")

</div>

that didn’t solve for me. Do you have any other ideas? I have this problem and I can’t solve it. we are in 2020 and this bug remains active

---

<div class="post-metadata">

**Author:** ![stromdh](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/stromdh/32/690_2.png) [@stromdh](https://forum.mautic.org/u/stromdh)\
**Post date:** [January 22, 2020, 10:50pm UTC](https://forum.mautic.org/t/focus-item-form-modal-popup-not-closing-after-form-submission/8900/5 "2020-01-22T22:50:02Z")

</div>

the solution to this topic is simple. The modal does not close because the mautic-form.js file is not loaded.

To solve this problem, go to settings and change the path to the website that should look like this: [https://yourmauticdomain.com/index.php](https://yourmauticdomain.com/index.php)

just remove the index.php just getting [https://yourmauticdomain.com/](https://yourmauticdomain.com/)

---

<div class="post-metadata">

**Author:** ![dirk\_s](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dirk_s/32/748_2.png) [@dirk\_s](https://forum.mautic.org/u/dirk_s)\
**Post date:** [January 25, 2020, 11:09am UTC](https://forum.mautic.org/t/focus-item-form-modal-popup-not-closing-after-form-submission/8900/6 "2020-01-25T11:09:21Z")

</div>

You could also update the related issue in Mautic with this helpful workaround:

> <https://github.com/mautic/mautic/issues/6657>
>
> What type of report is this:
> 
> Q
> A
> 
> 
> Bug report?
> X
> 
> Feature request?
> 
> Enhancement?
> 
> 
> Description:
> We have a focus item on our site that pops up asking for the...
