Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save spivurno/cee0e1c372bf988019e1 to your computer and use it in GitHub Desktop.
Save spivurno/cee0e1c372bf988019e1 to your computer and use it in GitHub Desktop.
Gravity Wiz // Gravity Forms // Populate Field Value from One Page to Field in Subsequent Page
/**
* Gravity Wiz // Gravity Forms // Populate Field from One Page to Field in Subsequent Page
* http://gravitywiz.com/
*/
// update "1074" to the ID of your form
add_filter( 'gform_pre_render_1074', function( $form ) {
foreach( $form['fields'] as &$field ) {
// update "2" to the field ID on the later page
if( $field->id == 2 ) {
// update "1" to the field ID on the earlier page
$field->defaultValue = rgpost( 'input_1' );
}
}
return $form;
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment