PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

gform_pre_submission copy field to custom field

  1. draney
    Member

    I am trying to copy a website url field (ID:28) to a custom field (ID:19) and have the following in my functions file, but it is not working. What am I doing wrong?

    add_action('gform_pre_submission', 'copy_field_value');
    function copy_field_value($form) {
        // copy the value which was submitted in
        // field 28 to hidden field 19
        $_POST['input_28'] = $_POST('input_19');
    }

    In fact when I do a test with this, the website URL entered in field 28 shows up in my form submission preview, but is missing from the final submission. The custom field #19 doesn't show in the preview of the final submission.

    Posted 5 years ago on Friday April 26, 2013 | Permalink
  2. David Peralty
    Administrator

    Your code is correct. Doesn't look like you are doing anything wrong to me. Can you link to your form and give me more information about your set-up? Are you running the latest Gravity Forms and WordPress versions?

    Posted 5 years ago on Friday April 26, 2013 | Permalink
  3. draney
    Member

    Here is a link to the form, but please remove it from the thread:
    -removed-

    I am using latest WP and GF

    Posted 5 years ago on Friday April 26, 2013 | Permalink
  4. draney
    Member

    I'm not sure you got my reply above. Can you help?

    Posted 5 years ago on Tuesday April 30, 2013 | Permalink
  5. draney
    Member

    Will you please remove my website URL from my April 26 post (above)?

    Posted 5 years ago on Tuesday May 7, 2013 | Permalink
  6. David Peralty
    Administrator

    Were you able to solve the issue with the form? I did finally notice an issue with your code... You have round brackets in one and square in the other. They should both be square brackets.

    Posted 5 years ago on Tuesday May 7, 2013 | Permalink