I've been looking around in the forums for a while and am using the code snippet from this post:
http://www.gravityhelp.com/forums/topic/populate-field-from-previous-field
This is my version of the code from functions.php, but it's not working:
// update "108" to the ID of your form
add_filter("gform_pre_render_2", "populate_previous_page_data");
function populate_previous_page_data($form){
$page_number = rgpost("gform_target_page_number_{$form["id"]}");
$page_number = !is_numeric($page_number) ? 1 : $page_number;
foreach($form['fields'] as &$field) {
if($field['id'] != 42.5) // update "15" to the ID of the field you wish to be populated;
$field_page = rgar($field, 'pageNumber');
if($page_number > $field_page)
continue;
// update this to the ID of the field whose value you wish to call
// '16.3' = example, first name of a Name field
// '16.6' = example, last name of a Name field
$field['defaultValue'] = rgpost('1');
}
return $form;
}
My form is here, and I'm trying to prepopulate the Zip code field on the last page with the value entered on the first page. Can someone help?