Created
November 16, 2015 02:46
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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