Does GF store form data during validation or when moving between page ? if so, where?

Hi, i populate some values in a list field and checkboxes dynamically in a multipage form.
for example, these two fields:

//list field 
add_filter( 'gform_column_input_1_1_1', 'dynamic_field_populate', 10, 5 );
function dynamic_field_populate( $input_info, $field, $column, $value, $form_id ) {
    return array( 'type' => 'select', 'choices' => 'ABC ,EFG' );
}
//checkboxes field
add_filter( 'gform_column_input_content_1_1_2', 'checkbox_field', 10, 5 );
function checkbox_field( $input_info, $field, $column, $value, $form_id ) {

	$input_field_name = 'input_0';
	
	$new_input = '<div  class="gfield_checkbox"  id="input_' . $form_id . '_'. $field["id"] .'[]">';
	$new_input .= '<div class="gchoice gchoice_1_1_2_0" style="justify-content: center;">
						<input class="gfield-choice-input" name="' . $input_field_name . '" type="checkbox" value="No" id="choice_1_1_2_0" '. GFCommon::get_tabindex() .' aria-label="wpa" data-aria-label-template="">
						<label for="choice_1_1_2_0" id="label_1_1_2_0[]">Yes</label>
					  </div>';				  	 
	$new_input .= '</div>';		
	 return $new_input;

} 

when validating (on submit) or moving between pages, the chosen selection values are lost and some field values appear on other fields. i believe this is coming from the checkboxes field created by the filter. perhaps because they dont have a unique id once duplicated by the row-add functionality.
Any ideas how to make it work ?

Thanks

Hi Guy,

Not exactly a fix for the issue you describe but if you use. Gravity Forms Populate Anything - Enable Dynamic Population - Gravity Wiz to get the data populated into the fields, it should handle adding Unique ID’s to each and keeping the values when navigating between pages. Plus, you will be able to populate almost any data into a Gravity Forms without additional coding (you can even populate data from a Google Sheet or a custom MySQL database).

I hope this helps :man_mage:

Best,

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