I am trying to get the value of Field 3 entered into the value for Field 4 [RESOLVED]

I have used the following code and inserted it into code snippets - does it need something else to work?
When I make or edit an entry the Field 4 is not being updated.

add_action( 'gform_pre_submission_85', 'pre_submission_handler' );
function pre_submission_handler( $form ) {
        $_POST['input_4'] = rgpost( 'input_3' );
}

The code appears to be missing quotes around the string values, which would cause it to break. The corrected code should look like this:

add_action( 'gform_pre_submission_85', 'pre_submission_handler' );

function pre_submission_handler( $form ) {
    $_POST['input_4'] = rgpost( 'input_3' );
}

Make sure to replace the 85 in the gform_pre_submission_85 hook with the actual ID of your Gravity Form.

If the code still doesn’t work, you may want to check for any error messages or if the hook is being triggered by adding a debugging statement to the function.

All sorted thanks

1 Like