Gravity Forms: Submit Form When Radio Button is Selected

Nov 27, 2020

3 Min. Read

Share URL

This page may contain affiliate links. Please read my disclaimer for more information.

In this tutorial, I’ll show you how to use a Radio field to submit a form built with Gravity Forms. I will also demonstrate how to use conditional logic Confirmations to vary the action when the form is submitted.

How it works

With this solution, you will be replacing the need for the submit button on your form.

Instead of using the submit button, each choice in your radio field will complete the action of submitting the form.

You can use a single radio button or have a list of several radio buttons and use confirmation conditional logic to control what happens when that form is submitted.

What you’ll need

In order for this to work you will need the following.

Usage

The snippet below will create the magic.

https://gist.github.com/chrisegg/8ea3c0f0573eef489cb4cfcb48e56751

Place the code directly in the form inside an HTML block.

Putting this JS code in the an HTML field will prevent this function from being triggered by another form on your site.

The Conditional Logic

This radio button has four different confirmation results.

Will The Entries Still Be Recorded?

Yes. The submission action will work the same as it would if you were to use a button.

  1. Form entries will be recorded
  2. Confirmation action performed (message, page, redirect)

Removing the Form Button

In this case, it makes sense to remove the form button because I want the submission to be created by the radio button choice. So we will need a simple CSS snippet, shared below.

Be sure to replace ID, with your form ID number (i.e #gform_wrapper_12)

https://gist.github.com/chrisegg/2dee51496d507cbc72a16ec4ff9a22ce

Put this code in your themes style.css file or in the Customizer in Appearance => Customize => Additional CSS

Learn how to add the code to your site using a functionality plugin.

Important: Do NOT Enable Ajax

When adding the form to you page, it is important that you do NOT enable Ajax. This will break the radio button magic.

When using the Gravity Forms shortcode, make sure ajax=”false”:

Questions? Issues?

For assistance with this, please use the comments below!

Photo of author
About the Author
Chris Eggleston
Husband. Father of 4. Grandpa of 2. Chief Problem Solver exploring business systems, technology, AI & faith — helping people solve real problems. @mantiswp @chrisegg

Support Chris - Donate $5

Gravity Wiz Add-Ons

Advertisement

4.5 2 votes
Article Rating
Subscribe
Notify of
guest
5 Comments
Inline Feedbacks
View all comments
Scott
Scott
2 years ago

This doesn’t seem to work on multi page forms. Ideas why or how to fix?

Scott
Scott
Reply to  Chris Eggleston
2 years ago

I should have been more clear. It doesn’t work if you try to place the new submit control anywhere except on the last page of the form. My project specs require a submit button for the entire form prior to the final page.

Scott
Scott
Reply to  Chris Eggleston
2 years ago

Ok. Unfortunately that’s what I’m trying to figure out a workaround around for.

Related Post

How to Secure a Digital Broadcast Page with Gravity Forms Submit to Access Add-On

Live events and webinars are powerful ways to connect with your audience, but hosting them directly on your WordPress site...

Oct 3, 2025

4 min. read

Step-by-Step Guide: Sending a Gravity Forms Notification to the User

Gravity Forms notification feature allows you to send emails to users automatically when they submit a form. This is useful...

Mar 20, 2025

5 min. read

Gravity Forms Multi-Date Picker

Gravity Forms is a powerful form builder, but you might occasionally find some limitations. For example, the date picker field...

Nov 13, 2024

4 min. read

How to Migrate From WS Forms to Gravity Forms: A Step-by-Step Guide

Migrating from WS Forms to Gravity Forms can seem daunting, but with the right approach, it can be a smooth...

Oct 26, 2024

4 min. read

How to Connect Gravity Forms to SendFox: A Step-by-Step Tutorial

This tutorial will walk you through connecting Gravity Forms to SendFox and ensuring your contacts are added to your email marketing...

Oct 16, 2024

5 min. read

How to: Gravity Forms BMI Calculator

Many people don’t realize that the calculation feature is built into the Gravity Forms core plugin and is available for...

Oct 10, 2024

4 min. read