Jason Kinney
Jason Kinney

Reputation: 15

How to make fancybox close after hitting "submit button"

My form comes from Hubspot and is embedded into a fancybox.

I would like the box to close as soon as the person hits "submit" but instead it redirects and stays open.

Secondly, I tried entering the code to clear the content box after submission but the old data stays in the fields after reopening.

  1. How do I make the box close after they "submit"?

  2. How do I code so that fields clear after each submission?

http://online.saintleo.edu/FancyBox2/FancyBox.html

In advance, thank you. You guys/gals are great.

Upvotes: 1

Views: 2016

Answers (2)

code_rum
code_rum

Reputation: 922

After inspecting your Fancybox I found this html:

<form accept-charset="UTF-8" enctype="multipart/form-data" id="hsForm_bc762bf8-087a41ec-8f55-263df96f988a" class="hs-custom-form stacked hs-form" action="https://forms.hubspot.com/uploads/form/v2/206683/bc762bf8-087a-41ec-8f55-263df96f988a" method="POST" novalidate="novalidate">

It works as expected when I add target="_top" to it.

Your form.html may have a form tag. Add target="_top" to it.

Upvotes: 1

code_rum
code_rum

Reputation: 922

See this link Link here

Add target="_top" in form tag

<form target="_top">

Upvotes: 0

Related Questions