• Resolved thedogbox

    (@thedogbox)


    Hi, great plugin.

    I found that if you have validation errors on a page, then any changes you’ve made to other fields on the page will revert to their original value.

    A quick and simple fix is to test for the current page on the pre-populate filter and only re-load the form if you are on page 1.

    function ri_pre_populate_the_form($form) {
        if ($form['isPersistent']) {
    
    		$current_page = GFFormDisplay::get_current_page($form["id"]);
    		if ($current_page == 1) {
    			$option_key = ri_getFormOptionKeyForGF($form);
    			if (get_option($option_key)) {
    				$_POST = json_decode(get_option($option_key), true);
    			}
    		}
        }
    
        return $form;
    }

    https://wordpress.org/plugins/gravity-forms-data-persistence-add-on-reloaded/

Viewing 1 replies (of 1 total)
  • Plugin Author unclhos

    (@unclhos)

    Thank you for the suggestion. I have added it to the plugin and released an update.

Viewing 1 replies (of 1 total)
  • The topic ‘Validation errors wipe out other fields on page’ is closed to new replies.