Form in Modal Window - submit without page refresh

Michael D asked on February 2, 2021 20:45

We have a Feedback Form that we would like to display in a Bootstrap Modal Window. It works fine except that when you submit the form, the page refreshes and you don't see the Thank You Msg.

Is there a way to submit the form but keep the modal window open to display the thank you msg?

Correct Answer

Brenden Kehren answered on February 3, 2021 15:32

Then on your master page template, make a modification to it. Place a webpart zone where the modal code goes. Then in that webpart zone add the "biz form" webpart and select the form you want to show. In the content before and after add the modal wrapping div code. Then finally at the bottom of the webpart, check the box to add an update panel around the webpart.

If you follow these directions, what may happen is your modal code may get wrapped inside the update panel. This is not ideal. The reason I suggested doing it this way first is so you can properly configure the webpart. If you have your modal code in the template and try to add a webpart to that zone, it won't work because the modal area will be hidden by default. So once you've configured your webpart, remove the content before and after from the webpart and add it back to the template around that web part zone.

0 votesVote for this answer Unmark Correct answer

Recent Answers


Brenden Kehren answered on February 3, 2021 14:21

What version are you using? Assuming you're using portal engine and not MVC, you can either check the checkbox to wrap the webpart in an update panel OR update your code to have a cms:UpdatePanel wrapped around it.

0 votesVote for this answer Mark as a Correct answer

Michael D answered on February 3, 2021 14:27

Thanks Brenden. I'm using v10.

Where is that checkbox? Sorry, I don't think I've heard of an Update Panel.

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on February 3, 2021 14:28

How did you place the form in the page?

0 votesVote for this answer Mark as a Correct answer

Michael D answered on February 3, 2021 14:29

The On-line form widget. then I cut that code and pasted it into the Bootstrap Modal code.

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on February 3, 2021 14:34

With a widget it's a bit more difficult to do but not impossible. It's much easier creating a one odd template and doing the biz form webpart to the template and checking the property to add an update panel around it.

0 votesVote for this answer Mark as a Correct answer

Michael D answered on February 3, 2021 14:38

This is going on our homepage so a new template is out of the questions (I get possible to do but would be a lot of effort).

Do you know what I'll need to do since I'm using a widget?

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.