🎉 Celebrate with 10% OFF on All Products! Use Code: GFEX10 Or Buy Any 2+ Items for 30% OFF with Code: GFEX30!
Guides & Tutorials October 20, 2026

How to Add a Toggle Switch Field to Gravity Forms (Custom Values, Labels and Pricing)

GravityExtra
How to Add a Toggle Switch Field to Gravity Forms (Custom Values, Labels and Pricing)

A checkbox is a fine control until you ask a customer a simple yes or no question and you need the answer to look obvious. A switch fixes that. Everyone knows how it works from their phone: it is either on or off, and the label tells you what that means. If your forms run on Gravity Forms, you can add the same control with a real field. In this tutorial we build a small preferences form with the Gravity Forms Toggle Switch add-on, make a terms switch that must be on, show a field only while a switch is off, use switches in a calculation and add a gift wrap price to an order.

An Account preferences form with three single switches, a group of three notification switches and a required terms switch, each with a label beside it that shows the current state
Single switches with their own labels, a group of switches and a required switch, in the Orbital theme.

Why a Switch Instead of a Checkbox?

A checkbox says nothing when it is empty. It sends nothing to the server, so an entry cannot tell the difference between a customer who said no and a customer who never saw the question. A switch makes the two states equal. Both are answers, both are saved, and both can carry text that makes sense to the person reading the entry. That is why a switch is a good fit for subscribe or do not subscribe, gift wrap or no gift wrap, and agree or not yet.

The add-on adds a field called Toggle Switch. You choose the text that is saved for the on state and the off state, for example Yes and No or 1 and 0, and the labels that are shown beside the switch. The field is a real checkbox underneath, so it works with the rest of Gravity Forms: conditional logic, calculations, notifications, entries and payments.

Step 1: Add the Field

Open your form in the editor and add Toggle Switch from the Advanced Fields group. Give it a label such as Product news. In the General tab you will find the settings of the switch.

The settings of the Toggle Switch field in the form editor: mode, on and off values, labels beside the switch, default state, size, colour and the price when on
Everything is set on the field itself in the form editor.
  1. Choose the on value and the off value. For a newsletter Yes and No are fine; for a calculation you would use numbers.
  2. Write the labels beside the switch: Subscribed for the on state and Not subscribed for the off state. The visitor always sees the label that matches the state.
  3. Choose the default state. A newsletter switch that starts on is a decision you make for the customer, so use it with care; a gift wrap switch should start off.
  4. Pick a size, small, medium or large, and leave the colour on the form theme so the switch matches your design, or choose a colour of your own.

Step 2: A Terms Switch That Must Be On

Consent has to be an active choice. Add another switch, label it Terms and give it the on label I accept the terms of service and the off label I do not accept yet. Then tick Required. For a switch, required means the switch must be on. If a visitor sends the form with the switch off, the form is not sent and the field shows the message Please switch this on to continue. You can change the text under the field settings. The switch keeps its position while the error is shown, so the visitor only has to flip it.

This is the same rule a required checkbox has, but the wording on the screen is clearer: the visitor sees I do not accept yet next to a grey switch and I accept the terms of service next to a coloured one.

Step 3: Show a Field While a Switch Is Off

Conditional logic can use a switch as a source. In the rules of another field, choose the switch, the operator is, and one of its two values. The list offers both the on value and the off value, which means you can react to the off state as well. A field with the label Tell us why not can be shown while the newsletter switch is off, and a field for the email address can be shown while it is on. A hidden field is not saved, as always.

A switch can also be the target. You can show a switch such as Send it by post only when another switch says that an invoice is needed. A group of switches works as a source too, the way checkboxes do.

Step 4: Use a Switch in a Calculation

Give a switch numeric values and it becomes a number in a formula. Imagine a quote form with a base price and two switches. The Rush switch has on value 25 and off value 0. The Double switch has on value 2 and off value 1. A number field with calculation turned on can use this formula.

({Base price:1} + {Rush:2}) * {Double:3}

The result changes live while the visitor flips the switches, and the server calculates it again when the form is sent, so the saved number is always right. A hidden switch counts as zero.

Step 5: Add a Price When a Switch Is On

Switches are a natural way to offer extras. In the field settings, enter an amount under Price when on. For a gift wrap switch enter 5. The amount is shown beside the label, and when the switch is on it is added to the total. You decide how it is counted: as its own line in the order, or as part of a product price. A product price is multiplied by the quantity, like a product option, which is what you want for an engraving on every mug. The form needs a product field and a Total field, because Gravity Forms calculates the total from the products.

A Mug order form with a product, a quantity, a Gift wrap switch that adds 5 dollars, an Engraving switch that adds 3.50 dollars to the product, three priced group switches and a total of 115.25 dollars
Switches can add to the order: as their own line, as part of a product price, or one by one in a group. The total follows live.

Groups can have prices too. In a group of switches every switch has its own price, and each switch that is on is added to the order as a line of its own. The order summary, the entry and your payment add-on all use the same lines.

Several Switches in One Field

When you have a list of options that can each be on or off, switch the field to Group of switches. You list the switches, and for each one you set a label, a value, a price and whether it starts on. Underneath it is a checkbox field, so entries, exports, merge tags and conditional logic work as you expect: every switch has its own input in the entry, and a merge tag lists the switches that are on. Use it for notification channels such as email, text message and push, or for the interests of a subscriber.

What the Visitor Experiences

The switch is a real checkbox with the role switch, so assistive technology announces it as a switch and reads its state. The keyboard works as expected: Tab moves to the switch and shows a clear focus ring, Space toggles it, and Enter toggles it too without sending the form. The labels are real text. The label that does not apply to the current state is hidden for everybody, including screen readers, so nobody hears both.

It also works without JavaScript. The look of the switch is drawn with CSS, and the checkbox underneath keeps working: a click checks it, the label changes and the form sends the right value. The script only adds aria-checked and the Enter key, and connects the off value to conditional logic and the total.

AJAX, Multi-Page Forms and Save and Continue

Forms are rarely simple. The switches keep their state when an AJAX form shows a validation error, and they keep it when a visitor moves back and forward in a multi-page form, with or without AJAX. Save and Continue is the case that most plugins forget: a visitor saves on page one, comes back later and goes on to page two. A switch whose default is On on page two is still On, because the add-on only saves a state for pages that were shown. In the admin entry editor the switch appears in its saved state and you can change it like any other field.

Tips for Better Switch Forms

  • Write the labels as short sentences that describe the state: Subscribed and Not subscribed, not On and Off.
  • Use numeric values only when you need them in a calculation. Words are better for people who read entries.
  • Do not start a consent switch in the on position. Consent has to be an active choice.
  • Use a required switch for terms and a normal switch for everything else.
  • Keep the size medium for desktop forms and use large for forms that are mostly filled in on phones.
  • Put prices in the field settings so the amount is shown beside the label and the visitor is never surprised.

Does It Slow My Site Down?

No. The field adds one small stylesheet and one small script, and only on pages that contain a Toggle Switch. The switch is drawn with CSS, there are no images and no fonts to load, and the add-on never contacts another website.

Frequently Asked Questions

Do I need a developer?

No. Everything is set in the form editor. There is no code to write, and the optional styling is a handful of CSS custom properties.

What is saved when the switch is off?

The off value you chose, such as No or 0, so an entry always has an answer.

Does it work with the Orbital theme and with legacy markup?

Yes. The switch looks the same in both, and it uses the accent colour of the form theme unless you choose a colour of your own.

Can the price depend on the quantity?

Yes. Count the amount as part of a product and it is multiplied by the quantity of that product. Count it as its own line and it is added once.

A switch is a small control with a big effect on how a form feels. With real values, clear labels and the full set of Gravity Forms features behind it, it turns yes and no questions into answers that are easy to read, easy to report on and easy to price.

Switch it on, save what you say

On/off switches with your own values, labels, pricing and conditional logic for Gravity Forms.

0
0
Your Cart
Your cart is emptyReturn to Shop
🔥 FREQUENTLY BOUGHT TOGETHER
Complete Combo & Save 40%!
ITEM IN YOUR CART
Gravity Forms Klaviyo Add-on
$39.00/yr
+
🎁 RECOMMENDED ADD-ON SAVE 40% OFF
Original Price: $39.00/yr
Bundle Special Price: $23.40/yr