• 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://www.ads-software.com/plugins/gravity-forms-data-persistence-add-on-reloaded/

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