# Add option to form submit button

**URL:** <https://community.gravityforms.com/t/add-option-to-form-submit-button/20099>\
**Category:** Get Help\
**Tags:** gform\_editor\_js, custom, gform\_field\_appearance\_settings\
**Created:** [February 25, 2026, 11:51pm UTC](https://community.gravityforms.com/t/add-option-to-form-submit-button/20099 "2026-02-25T23:51:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![curtismchale](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/curtismchale/32/6298_2.png) [@curtismchale](https://community.gravityforms.com/u/curtismchale)\
**Post date:** [February 25, 2026, 11:51pm UTC](https://community.gravityforms.com/t/add-option-to-form-submit-button/20099/1 "2026-02-25T23:51:33Z")

</div>

I’m trying to add a checkbox to the submit button appearance options. The button shows up but doesn’t live through a save. I leave the form and come back and the checkbox is not checked.

```auto
php
<?php

/**
 * Adds an "Apply Action Button Color" checkbox to Form Settings → Form Button.
 * GF's Settings API natively handles saving and restoring the value on the form object.
 */
function proud_action_button_form_setting($placement, $form_id)
{
    if ($placement == 50) { ?>
        <li class="action_setting field_setting">
            <input type="checkbox" id="proudActionButton" onclick="SetFieldProperty('proudActionButton', this.checked);" />
            <label for="proudActionButton" style="display:inline;">
                <?php _e("Action Button", "your_text_domain"); ?>
                <?php gform_tooltip("form_field_action_color") ?>
            </label>
        </li>
    <?php
    }
}
add_filter('gform_field_appearance_settings', 'proud_action_button_form_setting', 10, 2);

function proud_editor_script()
{
    ?>
    <script type='text/javascript'>
        //adding setting to fields of type "text"
        fieldSettings.submit += ", .action_setting";
        //binding to the load field settings event to initialize the checkbox
        jQuery(document).on("gform_load_field_settings", function(event, field, form) {
            jQuery('#proudActionButton').prop('checked', Boolean(rgar(field, 'proudActionButton')));
        });
    </script>
<?php
}
add_action('gform_editor_js', 'proud_editor_script');

function proud_add_action_button_tooltips($tooltips)
{
    $tooltips['form_field_action_color'] = "Checking this will apply the action button color from the Customizer to the form submit button.";
    return $tooltips;
}
add_filter('gform_tooltips', 'proud_add_action_button_tooltips');

```

I’m using the [appearance settings filter](https://docs.gravityforms.com/gform_field_appearance_settings/) because that seems to be the right one, though I grabbed the code from the [advanced settings](https://docs.gravityforms.com/gform_field_advanced_settings/) example because there were no examples provided in the appearance settings and [this forum post](https://community.gravityforms.com/t/added-a-custom-attribute-to-gravity-forms-field-but-is-innaccesible/13753) led me to advanced settings filters.

---

<div class="post-metadata">

**Author:** ![david](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/david/32/2517_2.png) [@david](https://community.gravityforms.com/u/david)\
**Post date:** [February 27, 2026, 1:08pm UTC](https://community.gravityforms.com/t/add-option-to-form-submit-button/20099/2 "2026-02-27T13:08:10Z")

</div>

The submit button isn’t a field per se so the `SetFieldProperty()` function won’t work here. This appears to be the easiest method to set a form button property:

```php-template
<input type="checkbox" id="proudActionButton" onclick="window.form.button.proudActionButton = this.checked;" />

```

---

<div class="post-metadata">

**Author:** ![curtismchale](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/curtismchale/32/6298_2.png) [@curtismchale](https://community.gravityforms.com/u/curtismchale)\
**Post date:** [March 3, 2026, 6:07pm UTC](https://community.gravityforms.com/t/add-option-to-form-submit-button/20099/3 "2026-03-03T18:07:10Z")

</div>

Thanks we have it working now.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/gravityforms1/original/2X/f/fef63f0599c45e0218c30d9f5d7ca8bff9b00189.png) [@system](https://community.gravityforms.com/u/system)\
**Post date:** [April 2, 2026, 6:07pm UTC](https://community.gravityforms.com/t/add-option-to-form-submit-button/20099/4 "2026-04-02T18:07:48Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
