# How to keep modal open upon gravity form submission

**URL:** <https://community.gravityforms.com/t/how-to-keep-modal-open-upon-gravity-form-submission/14071>\
**Category:** Get Help\
**Tags:** custom, modal, ajax, css\
**Created:** [December 14, 2022, 12:30am UTC](https://community.gravityforms.com/t/how-to-keep-modal-open-upon-gravity-form-submission/14071 "2022-12-14T00:30:01Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![user5ac66d7b1d4a87.4](https://avatars.discourse-cdn.com/v4/letter/u/e9bcb4/32.png) [@user5ac66d7b1d4a87.4](https://community.gravityforms.com/u/user5ac66d7b1d4a87.4)\
**Post date:** [December 14, 2022, 12:30am UTC](https://community.gravityforms.com/t/how-to-keep-modal-open-upon-gravity-form-submission/14071/1 "2022-12-14T00:30:02Z")

</div>

Hello, I have a gravity form on this page [Certified Nursing Assistant (CNA) Classes in Colorado Springs - NTSOC](https://ntsoc.com/cna-training-test-page/) that’s displayed via modal (#paymodal) upon selecting the PAY NOW button near the bottom of page.

The issue is that upon form submission, the page refreshes and closes the modal so users don’t know if form was completed sucessfully. I’d like to keep the modal open upon sumbission so that users know if there were any errors on form or if it’s submitted.

---

<div class="post-metadata">

**Author:** ![richardw8k](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/richardw8k/32/2354_2.png) [@richardw8k](https://community.gravityforms.com/u/richardw8k)\
**Post date:** [December 14, 2022, 11:42am UTC](https://community.gravityforms.com/t/how-to-keep-modal-open-upon-gravity-form-submission/14071/2 "2022-12-14T11:42:10Z")

</div>

Have you tried enabling Ajax on the method used to embed the form in that page?

---

<div class="post-metadata">

**Author:** ![user5ac66d7b1d4a87.4](https://avatars.discourse-cdn.com/v4/letter/u/e9bcb4/32.png) [@user5ac66d7b1d4a87.4](https://community.gravityforms.com/u/user5ac66d7b1d4a87.4)\
**Post date:** [December 14, 2022, 4:59pm UTC](https://community.gravityforms.com/t/how-to-keep-modal-open-upon-gravity-form-submission/14071/3 "2022-12-14T16:59:18Z")

</div>

Thank you for the reply, Richard. I have not. How should I go about doing that?

---

<div class="post-metadata">

**Author:** ![richardw8k](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/richardw8k/32/2354_2.png) [@richardw8k](https://community.gravityforms.com/u/richardw8k)\
**Post date:** [December 14, 2022, 5:24pm UTC](https://community.gravityforms.com/t/how-to-keep-modal-open-upon-gravity-form-submission/14071/4 "2022-12-14T17:24:52Z")

</div>

If the form is embedded using the Gravity Forms block, Ajax can be enabled in the block’s advanced settings.

For forms embedded using the shortcode you can add the `ajax=true` attribute to the shortcode.

If another method was used to embed the form, you’ll need to contact the developer of the theme or plugin that is making that embed method available to find out how to enable it.

---

<div class="post-metadata">

**Author:** ![user5ac66d7b1d4a87.4](https://avatars.discourse-cdn.com/v4/letter/u/e9bcb4/32.png) [@user5ac66d7b1d4a87.4](https://community.gravityforms.com/u/user5ac66d7b1d4a87.4)\
**Post date:** [December 14, 2022, 5:44pm UTC](https://community.gravityforms.com/t/how-to-keep-modal-open-upon-gravity-form-submission/14071/5 "2022-12-14T17:44:21Z")

</div>

Thanks, man. I tried that and I think I’m close now. So the modal stays open now which is great, however, the form doesn’t submit and I just get a spinning wheel

 ![Screen Shot 2022-12-14 at 10.44.04 AM](https://us1.discourse-cdn.com/flex020/uploads/gravityforms1/original/2X/f/fb1469bc342b64db78f2a3bdf009bc7d43525b8a.png)

---

<div class="post-metadata">

**Author:** ![chrishajer](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/chrishajer/32/88_2.png) [@chrishajer](https://community.gravityforms.com/u/chrishajer)\
**Post date:** [December 14, 2022, 11:40pm UTC](https://community.gravityforms.com/t/how-to-keep-modal-open-upon-gravity-form-submission/14071/6 "2022-12-14T23:40:28Z")

</div>

If the form will not work with AJAX, that means you have a JavaScript conflict of some sort on the site. You can use these steps to check for conflicts:

> **[Testing for a Theme/Plugin Conflict](http://docs.gravityforms.com/testing-theme-plugin-conflict/)**
>
> The following sections provide instructions for determining if an issue you are experiencing with Gravity Forms is caused by a theme or plugin conflict.

Before checking for conflicts, try embedding the form with AJAX in a page (not the modal) and see if it submits there. If it does, the issue with AJAX is related to the modal, not to any other conflict on the site.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/gravityforms1/original/2X/f/fef63f0599c45e0218c30d9f5d7ca8bff9b00189.png) [@system](https://community.gravityforms.com/u/system)\
**Post date:** [December 15, 2022, 11:41pm UTC](https://community.gravityforms.com/t/how-to-keep-modal-open-upon-gravity-form-submission/14071/7 "2022-12-15T23:41:00Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
