On Form Submit - Slide form Parent div off of screen
SOLVE
Hey Guys and Gals,
I am have created a fixed subscribe bar that contains a brief message and blog subscription form that slides down and fixes itself to the bottom of the screen after 15 seconds of being on one of our blog pages. I want the whole bar to dissapear and slide off screen on the successful submission of the form. Something I can get to work on non-hubspot forms but for some reason the hubspot form is giving me a difficult time. Any help would be appreciated.
.on(submit, function() {...} Doesnt seem to work for me with hubspot forms and someone else suggested that I try working it the way that I did here but that doesnt seem to be working either. Any help would be appreciated!
On Form Submit - Slide form Parent div off of screen
SOLVE
Glad, that makes sense!
There are 2 ways to place the form in the right spot
Option A: wherever you put the embed code, is where the form will end up (although I think the whole embed code needs to be there, including the necessary script files)...
On Form Submit - Slide form Parent div off of screen
SOLVE
I may be missing something in your explanation but you are including 2 forms into your page.
One with the {% blog_subscribe %} ... HUBL markup and another with the embed code.
The embed code contains (what looks like correct) markup to achieve your functionality but....
You may be submitting the wrong form that triggers the onFormSubmit. It looks like you are adding code to the embed that would be triggered based on the submission of the {% blog_subscribe %} form. It doesn't work that way. Form embeds have an isolated scope and onFormSubmit of "Form A" would not trigger the onFormSubmit of "Form B".
What I recommend is remove {%blog_subscribe %} and replace it with your embed code.
On Form Submit - Slide form Parent div off of screen
SOLVE
tjoyce -- thanks this actually makes a lot of sense, and is rather obvious as well. This may also be a silly question, but I am a bit new to working within hubspot. If get rid of the {% blog_subscribe %} form, how do I then tell the new form.create form where to be placed? Does that make sense?
On Form Submit - Slide form Parent div off of screen
SOLVE
Glad, that makes sense!
There are 2 ways to place the form in the right spot
Option A: wherever you put the embed code, is where the form will end up (although I think the whole embed code needs to be there, including the necessary script files)...
On Form Submit - Slide form Parent div off of screen
SOLVE
Right - I missed the target option in the documentation. One last thing, I hope, now I am getting an error in the debugger that says that hbspt is not defined, which to me is a ref to the fact that it must not be loading after everything else? even though its loaded on "ready". Any thoughts on why I might be getting that message?