spivurno
4/26/2016 - 3:32 PM

Gravity Perks // GP Nested Forms // Populate Nested Form Field

Gravity Perks // GP Nested Forms // Populate Nested Form Field

<?php
/**
 * Gravity Perks // GP Nested Forms // Populate Nested Form Field
 */
add_action( 'gform_enqueue_scripts', function( $form ) {
	if( $form['id'] == 508 ) {
		foreach( $form['fields'] as $field ) {
			if ( $field->id == 2 ) {
				$_POST["input_{$field->id}"] = '7631,7629';
			}
		}
	}
}, 9 );