Clear Specific Field Values on Reload

When reloading a form, you may want to preserve the submitted values in some values and remove them in others. This snippet provides a basic mechanism for achieving this. Be sure to enable the “Preserve values from previous submission” form setting in the “Reload Form” section.

Code

Filename: gprf-clear-specific-field-values-on-reload.php

<?php
/**
 * Gravity Perks // Reload From // Clear Specific Field Values on Reload
 * https://gravitywiz.com/documentation/gravity-forms-reload-form/
 *
 * When reloading a form, you may want to preserve the submitted values in some values and remove them in others. This
 * snippet provides a basic mechanism for achieving this. Be sure to enable the "Preserve values from previous submission"
 * form setting in the "Reload Form" section.
 */
// Update "123" to your form ID.
add_filter( 'gprf_disable_dynamic_reload_123', function( $return ) {
	function gprf_clear_specific_field_values( $return ) {
		// Update "3" to the ID of the field for whose value you would like to clear.
		$_POST['input_3'] = '';
		remove_filter( 'gform_pre_render', 'gprf_clear_specific_field_values' );
		return $return;
	}
	add_filter( 'gform_pre_render', 'gprf_clear_specific_field_values' );
	return $return;
} );

Comments

  1. Isaac McDaniel
    Isaac McDaniel August 29, 2025 at 3:48 am

    I tried using this snippet on a checkbox, even included the input’s sub-number, like $_POST[‘input_3.1’], but didn’t have success.

    Also could not get it to work with multi file inputs.

    Reply
    1. Samuel Bassah
      Samuel Bassah Staff August 29, 2025 at 4:54 am

      Hi Isaac,

      I can confirm what you’re experiencing. It appears the snippet doesn’t support the checkbox and file uploads fields. I’m forwarding this report to our developers to look into this and see if support can be added for those fields. We’ll update this comment with further information soon.

      Best,

Leave a Reply

Your email address will not be published. Required fields are marked *

  • Trouble installing this snippet? See our troubleshooting tips.
  • Need to include code? Create a gist and link to it in your comment.
  • Reporting a bug? Provide a URL where this issue can be recreated.

By commenting, I understand that I may receive emails related to Gravity Wiz and can unsubscribe at any time.