Forked from spivurno/gw-gravity-forms-populate-field-value-into-subsequent-field.php
Created
December 21, 2017 20:03
-
-
Save tharmann/e1ba078a50da4234c2008242f63c6f5d 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 hidden or 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