Skip to content

Instantly share code, notes, and snippets.

@NickDeckerDevs
Created October 9, 2018 16:34
Show Gist options
  • Select an option

  • Save NickDeckerDevs/52e9c47eebb8e51629211407d78f0799 to your computer and use it in GitHub Desktop.

Select an option

Save NickDeckerDevs/52e9c47eebb8e51629211407d78f0799 to your computer and use it in GitHub Desktop.
Hubspot inline form download module: S2M - CTA BG Image
<h3>The 10 Must-Ask Questions Before You Hire A Digital Agency</h3>
<!--[if lte IE 8]>
<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2-legacy.js"></script>
<![endif]-->
<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2.js"></script>
<script>// <![CDATA[
hbspt.forms.create({
css: '',
portalId: '#####',
formId: '#############################',
onFormSubmit: function($form) {
var pdf = 'https://www.square2marketing.com/hubfs/gated-downloads/FILENAME.PDF';
window.open(pdf);
$('.hs-button').hide();
$('.hs-input').hide();
var message = '<div class="thankyou">';
message += '<p>If your browser blocked the popup you can <a href="'+ pdf +'" target="_blank">click here to download the case study</a>.</p></div>';
$('.hbspt-form').append(message);
}
});
// ]]></script>
<!--[if lte IE 8]>
<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2-legacy.js"></script>
<![endif]-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment