CMS Development

Srinivas1
Member

Button or CTA with an Form

Hello Folks,

 

Greetings for the day!!!

 

Can I create a form in Hubspot like, When a person sees a button Example[Download Now] and he clicks on it and form pops out asking his Name and Contact details?

or 

[2 step for]

When he clicks the button First step of the form show name once he fills the second step shows email id and Download.

 

Regards,

Srini

0 Upvotes
1 Reply 1
Jsum
Key Advisor

Button or CTA with an Form

@Srinivas1,

 

Do you need the button clicks to be tracked? overwriting a Hubspot cta's href to turn it from a link to a javascript trigger is complicated. I'm not even sure it is possible but it is something I have been trying to find the time to look at by request.

 

if you don't need to track it then your question isn't a Hubspot question, it's a web dev question and is fairly simple if you know a little javascript. 

<a class="form_pop" href="#">Button</a>

<div class="form_container" style="display:none;"></div>

<script>
    $('.form_pop').on('click touch', function() {
      if ($('.form_container').css('display', 'none')) {
        $('.form_container').show();
     } else {
        $('.form_container').hide();
    }
    }
</script>

This is a very basic example. add a form module in the "form_container" div and when you click the button that div will show, and the form with it.