How to Submit a Form Without Values – Gravity Forms

Oct 18, 2024

3 Min. Read

Share URL

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

Problem

Gravity Forms has a validation feature that prevents you from being able to submit a form if all fields are empty, even if they are not required. This help doc will show you how to bypass validation.

The specific error is: At least one field must be filled out.

I am not sure why you’d want someone to be able to submit a form without populating any of the fields, but that was a recent request I received from two Gravity Forms users over the past couple of weeks.

Solution

I have two possible solutions for this request that will enable you to bypass validation.

One option uses a code snippet, and the other uses a hidden field (no code).

No Code

This solution uses a hidden single text field with a default value. You can even use conditional logic to ensure that the hidden field is only evaluated when all visible fields are empty.

  1. Add a single line text field to the form
  2. Change the visibility to hidden
  3. Add Default Value

If you want to use conditional logic, here is an example of how you’d set that up.

Code

This solution only requires adding the code snippet below to your site. It can be added to your themes functions.php file or a code snippet plugin.

You need to make only one modification: replace the 1 in gform_validation_1 on the first line of the code with your form ID number.

/**
 * GravityRanger // Gravity Forms // Bypass empty field validation 'At least one field must
 * be filled out'
 * https://gravityranger.com/
 *
 * This snippet will allow you to bypass validation and submit an empty form.
 * Replace the 1 in gform_validation_1 with your forms ID to apply to a specific form. Or
 * remove _1 to apply to all forms.
 * NOTE: This will bypass validation even if fields are marked as required.
 * 
 */


add_filter( 'gform_validation_1', 'custom_gform_validation' );
function custom_gform_validation( $validation_result ) {
    // Get the form object from the validation result
    $form = $validation_result['form'];

    // Create a flag to track if any field has been filled
    $is_filled = false;

    // Loop through the form fields to check if any field is populated
    foreach ( $form['fields'] as $field ) {
        $field_value = rgpost( 'input_' . $field->id );
        if ( !empty( $field_value ) ) {
            $is_filled = true;
            break;
        }
    }

    // If no field is filled, set the validation result to true (allow empty form submission)
    if ( !$is_filled ) {
        $validation_result['is_valid'] = true;
    }

    return $validation_result;
}

This code will bypass validation for required and non-required fields.

NEED MORE HELP?

If you still need help, feel free to use the comments or chat options below.

If you have an active Gravity Forms license, you can also open a support ticket here.

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

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments

Related Post

Automatically Switch from a Registration Form to a Waitlist in Gravity Forms

This tutorial shows you how to automatically switch from a registration form to a waitlist form in Gravity Forms using entry limits or attendee tracking with a custom shortcode.

Sep 29, 2025

4 min. read

Using AI + Gravity Forms to Streamline Job Applications

Hiring is tough. Sorting through dozens, or even hundreds, of job applications is time-consuming, repetitive, and prone to human bias. That’s where combining Gravity Forms, Gravity Flow, and AI automation comes in.

Sep 26, 2025

2 min. read

Turn Gravity Forms Image Choice Field into carousel

Problem Recently, I saw a Gravity Forms user looking for a way to style the new Image Choice field. Specifically,...

Jul 14, 2025

3 min. read

Offer Subscription With One-Off Add-On Product Options with Gravity Forms

Want to offer a subscription + one-time add-ons in Gravity Forms? Here’s how to do it using Stripe’s setup fee feature in a single payment feed.

Mar 24, 2025

2 min. read

Gravity Forms A/B Split Testing

Problem We recently received an interesting request from a Gravity Forms user who wanted to know how to do A/B...

Mar 21, 2025

5 min. read

Gravity Forms Field Validation Based on Form Entries

Problem Recently a client reached out with a very specific request for a project she was working on. Simply put,...

Mar 20, 2025

3 min. read