Forked from spivurno/gw-gravity-forms-populate-field-value-into-subsequent-field.php
Created
September 5, 2016 04:25
-
-
Save phillipwilhelm/effe7a165a9e5506c44485feda0710f0 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