<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Betreff: Custom Form Button in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/Custom-Form-Button/m-p/670031#M29706</link>
    <description>&lt;P&gt;This worked... thanks so much!&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 24 Jul 2022 16:50:52 GMT</pubDate>
    <dc:creator>asiaferguson</dc:creator>
    <dc:date>2022-07-24T16:50:52Z</dc:date>
    <item>
      <title>Custom Form Button</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Custom-Form-Button/m-p/669720#M29691</link>
      <description>&lt;P&gt;Hi -&lt;/P&gt;&lt;P&gt;I'm using an embedded form on this page:&amp;nbsp;&lt;A href="https://tactics.30mpc.com/charly-johnsons-cold-email-drip-templates" target="_blank"&gt;https://tactics.30mpc.com/charly-johnsons-cold-email-drip-templates&lt;/A&gt;&amp;nbsp;and I want to add custom styles the submit button only.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;The look they want for the button is similar to the 2 buttons down the page: pill shaped, black border, and black text. The rest of the form is fine how it is.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Is this even possible?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jul 2022 20:32:35 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Custom-Form-Button/m-p/669720#M29691</guid>
      <dc:creator>asiaferguson</dc:creator>
      <dc:date>2022-07-22T20:32:35Z</dc:date>
    </item>
    <item>
      <title>Betreff: Custom Form Button</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Custom-Form-Button/m-p/669754#M29694</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/297230"&gt;@asiaferguson&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;of course it's possible.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You've got several options.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. modify the embed code&lt;/P&gt;
&lt;P&gt;Let's pretend that this is your default embed code&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;&amp;lt;script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script&amp;gt;
  hbspt.forms.create({
    region: "na1",
    portalId: "XXX",
    formId: "xxxxxx-xxxxxx-xxxxxx-xxxxxxx-xxxxxxx"
  });
&amp;lt;/script&amp;gt;&lt;/LI-CODE&gt;
&lt;P&gt;You can modify it by adding some &lt;A href="https://legacydocs.hubspot.com/docs/methods/forms/advanced_form_options" target="_blank" rel="noopener"&gt;configurations options&lt;/A&gt;&amp;nbsp;and a bit of CSS.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To add a custom class to the button you can do it like this&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;&amp;lt;script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script&amp;gt;
  hbspt.forms.create({
    region: "na1",
    portalId: "XXX",
    formId: "xxxxxx-xxxxxx-xxxxxx-xxxxxxx-xxxxxxx", 
css:"", {#disables initial form styling #}
submitButtonClass: "myCustomButton"
  });
&amp;lt;/script&amp;gt;&lt;/LI-CODE&gt;
&lt;P&gt;CSS&lt;/P&gt;
&lt;LI-CODE lang="css"&gt;.myCustomButton{
border: 3px solid #000000;
background: #ffffff;
color: #0000000;
border-radius: 50px;
padding: 8px 16px;
font-size: 1.2rem;
line-height: 1.5rem;
}

.myCustomButton:hover{ {# styling for hover state #}
background-color:#000000;
color:#ffffff;
}

.myCustomButton:focus{ {# style for focus state #}
background-color:#c6fcd0;

}&lt;/LI-CODE&gt;
&lt;P&gt;Tipp:&lt;/P&gt;
&lt;P&gt;If you want to add a custom styling only to one particular page you can paste your CSS into the "additional &amp;lt;head&amp;gt; information" area in the page settings with a wrapping &amp;lt;style&amp;gt;-tag.&lt;/P&gt;
&lt;P&gt;If you plan to use this styling more than once I'd recommend to put the styling into your main CSS file and just add the class each time into the embed code.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. custom Module&lt;/P&gt;
&lt;P&gt;Almost the same as the previous version but much easier to handle.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To set up a custom module for this case&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;create a new custom module&lt;/LI&gt;
&lt;LI&gt;paste your default embed code(see default layout above) into the HTML+Hubl area&lt;/LI&gt;
&lt;LI&gt;add a form function to the module via the right sidebar&lt;/LI&gt;
&lt;LI&gt;copy/paste the form snippet into the HTML+Hubl area (temporary)&lt;/LI&gt;
&lt;LI&gt;modify the code like this&lt;/LI&gt;
&lt;/UL&gt;
&lt;LI-CODE lang="markup"&gt;{# this is the default form snippet - delete it before using the module. Otherwise you'll see two forms #}
{% form
	form_to_use="{{ module.form_field.form_id }}"
	response_response_type="{{ module.form_field.response_type }}"
	response_message="{{ module.form_field.message }}"
	response_redirect_id="{{ module.form_field.redirect_id }}"
	response_redirect_url="{{module.form_field.redirect_url}}"
	gotowebinar_webinar_key="{{ module.form_field.gotowebinar_webinar_key }}"
%}

&amp;lt;script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script&amp;gt;
  hbspt.forms.create({
    region: "na1",
    portalId: "XXX", {# replace with your HubID #}
    formId: "{{module.form_field.form_id}}", 
css:"",
onFormSubmit: "{{module.form_field.redirect_url}}"
  });
&amp;lt;/script&amp;gt;&lt;/LI-CODE&gt;
&lt;P&gt;After you've entered your informations you no longer need the default {% form %} code in the module - delete it.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The next step is to add the button styling option. You've got several options here.&lt;/P&gt;
&lt;P&gt;If you like to enter different classes add a simple text field(not rich-text) as a function via the right sidebar to the module and modify the code like this. I've called mine "Button class"&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;&amp;lt;script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script&amp;gt;
  hbspt.forms.create({
    region: "na1",
    portalId: "XXX", {# replace with your HubID #}
    formId: "{{module.form_field.form_id}}",
css:"",
onFormSubmit: "{{module.form_field.redirect_url}}",
submitButtonClass: "{{module.button_class}}"
  });
&amp;lt;/script&amp;gt;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to have it a bit more easier/bulletproof add a boolean(I call mine "Custom styling") instead of a textfield to the module(you can combine it - but it's not the approach here)&lt;/P&gt;
&lt;P&gt;The&amp;nbsp; code should look like this&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;&amp;lt;script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script&amp;gt;
  hbspt.forms.create({
    region: "na1",
    portalId: "XXX", {# replace with your HubID #}
    formId: "{{module.form_field.form_id}}", 
css:"",
onFormSubmit: "{{module.form_field.redirect_url}}",
{% if module.custom_styling %}submitButtonClass: "myCustomButton" {% endif %}
  });
&amp;lt;/script&amp;gt;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are many more options/ideas how you can overengineer those kind of modules.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;p.s: If something doesn't work - try the sledgehammer method by adding !important to each of the CSS lines. But this could lead you down the rabbit hole.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;best,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anton&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jul 2022 22:46:31 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Custom-Form-Button/m-p/669754#M29694</guid>
      <dc:creator>Anton</dc:creator>
      <dc:date>2022-07-22T22:46:31Z</dc:date>
    </item>
    <item>
      <title>Betreff: Custom Form Button</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Custom-Form-Button/m-p/670031#M29706</link>
      <description>&lt;P&gt;This worked... thanks so much!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 24 Jul 2022 16:50:52 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Custom-Form-Button/m-p/670031#M29706</guid>
      <dc:creator>asiaferguson</dc:creator>
      <dc:date>2022-07-24T16:50:52Z</dc:date>
    </item>
  </channel>
</rss>

