# Submit form style editable

**URL:** <https://community.hubspot.com/t/submit-form-style-editable/50235>\
**Category:** CMS Development\
**Tags:** design-manager, forms\
**Created:** [January 23, 2022, 7:44pm UTC](https://community.hubspot.com/t/submit-form-style-editable/50235 "2022-01-23T19:44:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mchomicki](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/mchomicki/32/29572_2.png) [@mchomicki](https://community.hubspot.com/u/mchomicki)\
**Post date:** [January 23, 2022, 7:44pm UTC](https://community.hubspot.com/t/submit-form-style-editable/50235/1 "2022-01-23T19:44:28Z")

</div>

Hello everyone, I have a custom module created, using the hubspot Form module, now what I would like to do, is give the option of selecting the background color of the submit button in the form, I’ve tried adding a color selector to the module, but it seems I am not able to use this variable withing the module CSS part.

Thanks !!

---

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [January 24, 2022, 12:19pm UTC](https://community.hubspot.com/t/submit-form-style-editable/50235/2 "2022-01-24T12:19:52Z")

</div>

Hi @mchomicki ,

Create one choice field for color like this

 ![webdew_0-1643026722402.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/3/d/3d72f7ef53f5b932a4fae5ea53c628c8efc73c8f.png)

Copy snippet and paste it to wherever you required like for border, background etc as shown in below snippet.

form input[type=submit], form .hs-button{

- border-style: solid;
- border-width: 2px;
- border-color: {{ module.choose\_submit\_color }};
- background:{{ module.choose\_submit\_color }};

}  
Hope this helps!  
If we were able to answer your query, kindly help the community by marking it as a solution.  
Thanks and Regard.

---

<div class="post-metadata">

**Author:** ![mchomicki](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/mchomicki/32/29572_2.png) [@mchomicki](https://community.hubspot.com/u/mchomicki)\
**Post date:** [January 24, 2022, 5:11pm UTC](https://community.hubspot.com/t/submit-form-style-editable/50235/3 "2022-01-24T17:11:56Z")

</div>

Hello [@webdew](https://community.hubspot.com/t5/user/viewprofilepage/user-id/131510)

Thanks for your reply!

Yes, tired that already, but apparently it is not possible to get the value from the color picker and use it in the CSS, but only on the hubl + HTML section, and the value would come out as empty, as you cans see in the pic, trying to find a way around it

Tanks!

![561965_1_Captura de pantalla 2022-01-24 a las 18.08.13.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/d/8/d8a187c0b1dd106a77eac5ecad08dd5f66a11174.png)

---

<div class="post-metadata">

**Author:** ![Brownstephen101](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/brownstephen101/32/52735_2.png) [@Brownstephen101](https://community.hubspot.com/u/Brownstephen101)\
**Post date:** [January 24, 2022, 2:57pm UTC](https://community.hubspot.com/t/submit-form-style-editable/50235/4 "2022-01-24T14:57:01Z")

</div>

@mchomicki Since you can’t access module variables in the CSS, you will need to put the CSS in the HTML of the module, wrapped in a {% require\_css %} wrapper, for example:  
This is the CSS required for a color picker named “button\_color” if you want to include Opacity.

```lia-code-sample
<div id="{{ name }}" class="module-html">
/* All your module html goes here */
</div>

{% require_css%}
<style>
#{{ name }} .form .hs-button {
 border-color: rgba({{ module.button_color.color|convert_rgb }}, {{ module.button_color.opacity / 100 }});
 background: rgba({{ module.button_color.color|convert_rgb }}, {{ module.button_color.opacity / 100 }});
}
</style>
{% end_require_css %}

```

Note: You will also want to use {{ name }} as the ID of the module wrapper and then reference that in your css so that if they choose different options for multiple modules on the same page, the options apply correctly to the corresponding module.

---

<div class="post-metadata">

**Author:** ![mchomicki](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/mchomicki/32/29572_2.png) [@mchomicki](https://community.hubspot.com/u/mchomicki)\
**Post date:** [January 24, 2022, 5:18pm UTC](https://community.hubspot.com/t/submit-form-style-editable/50235/5 "2022-01-24T17:18:24Z")

</div>

@Brownstephen101 worked like a charm,

much appreciated!!
