I would like the data in a form field to be put in a hidden field on the same form when a user hits the submit button. I am using the following code in my functions.php to set a relationship between 2 posts which basically is what I want. How should I use this code when I want two form fields to be the same when the form is submitted?
do_shortcode("[gravityforms id=2 field_values='ItemID={$post->ID}' ajax=true]");
add_action("gform_after_submission_2", "update_review_data", 10, 2);
function update_review_data($entry){
update_post_meta($entry["post_id"], "_wpcf_belongs_winkel_id", $entry[1]);
}