HubSpot CMS

Form 2

This form lets you adds a basic minimalistic form with a button. The form allows you to set background color, font color and one action after pressing the submit button. Including redirecting and displaying a message.

Created by: il-hubspot

Tags: Forms

Unverified
?

After receiving a minimum of 25 recommendations, an entry earns the "Community Approved" badge.

Please keep in mind, all entries are community created and may not be fully supported by HubSpot.

0 Recommendations

View on:

GitHub

HTML + HUBL


{{ require_css("//cdn2.hubspot.net/hubfs/346178/designmodo/ui-kit/ui-kit-content/css/ui-kit-styles.css") }}      
<!-- content-13 -->
<section class="content-13 content-13-v2 subscribe-form" style="background-color: {{ module.background_color.color }};">
    <div class="container">
        <div class="row js-form-btn-color" data-form-btn-color="{{ module.form_button_color.color }}" data-form-btn-hover-color="{{ module.form_button_hover_color.color }}">
          {% if module.form %}
            {% form
              form_key="d1144b5a-132a-8c47-fc9a-8e7dfe61db1c"
              form_to_use="{{ module.form.form_id }}"
              response_response_type="{{ module.form.response_type }}"
              response_message="{{ module.form.message }}"
              response_redirect_id="{{ module.form.redirect_id }}"
              response_redirect_url="{{module.form.redirect_url}}"
            %}
          {% endif %}
        </div>
    </div>
</section>

          
        
CSS
          
            
          
        
JS
          
            jQuery(document).ready(function($) {
    $(".content-13-v2").each(function() {
        var o = $(this);
        if (o.hasClass("init")) {
            return;
        }
        o.addClass("init");
      
      	var style = "";
      
      	var newId = "id-" + Math.random().toString().slice(2);
        o.attr("id", newId);
      
      	var btnColor = $(this).find(".js-form-btn-color").data("form-btn-color");
        if (btnColor && btnColor !== "#16a085") {
            style += "#" + newId + ".content-13 .hs_submit input[type='submit'] { background-color: " + btnColor + "; } \n";
            $("<style type='text/css'/>").html(style).appendTo("head");
        }
      
      	var btnHoverColor = $(this).find(".js-form-btn-color").data("form-btn-hover-color");
        if (btnHoverColor && btnHoverColor !== "#24deb4") {
            style += "#" + newId + ".content-13 .hs_submit input[type='submit']:hover, #" + newId + ".content-13 .hs_submit input[type='submit']:focus, #" + newId + ".content-13 .hs_submit input[type='submit']:active{ background-color: " + btnHoverColor + "; } \n";
            $("<style type='text/css'/>").html(style).appendTo("head");
        }
    });
});

          
        
Have Questions?

Ask technical questions in Slack.

HubSpot Developer Slack

Not a member yet? - join here
READ ME (VIEW IN GITHUB)

HubSpot

Form 2

This form lets you adds a basic minimalistic form with button. The form allows you to set background color, font color and action after pressing the button. Including redirecting and displaying a message.

Form 2 module demo can be visited here:

w.inboundlabs.co/feat6-form2

Form 2 module is FREE and is part of the Startup Framework FREE and PAID packages:

https://marketplace.hubspot.com/products/inboundlabs/startup-framework-marketplace

Have Questions?

If you have questions, please email me at github (at) inboundlabs.co


HubSpot

Not developing on HubSpot CMS yet?

We'd love to have you a part of our developer community!

 
0 Recommendations

Other Open Source Projects

Browse all other open source projects

CrankShaft Framework

A modern framework for accelerating build times on the HubSpot CMS. Based on a modified Bootstrap 4 framework.

Lead developers: Jon McLaren

Developer Chrome Extension

Chrome/Chromium extension for HubSpot CMS Developers that adds a developer menu, dark theme and useful shortcuts to commonly used HubSpot query parameters, resources, and tools for making HubSpot Development easier and more enjoyable.

Lead developers: Jon McLaren , William Spiro , Gonzalo Torreras

VS Code HubL Language Extension

This extension enables super fast local development of CMS pages, and is a great compliment to using the new local HubL server. It contains comprehensive HubL tag, function, filter and expression test auto-complete snippets, as well as their documentation.

Lead developers: William Spiro

Not coding on HubSpot CMS yet?

We invite you to explore why thousands of developers LOVE coding with HubSpot!

Contribute
Made with  by community members: InboundLabs.co