• Resolved paulred222

    (@paulred222)


    Hi. I have a contact 7 form with definition including:

    [hidden text ID default:get]
    <label> Your Name (required)
    [text* your-name] </label>

    The hidden ID field is populated from the ID field passed in the URL to the WordPress page (I am using a custom link)
    Within the PHP code handling the form submission using wpcf7_before_send_mail I have the normal code:

    function contactform7_before_send_mail( $wpcf7 ) {
    $form_to_DB = WPCF7_Submission::get_instance();
    $form_id=$wpcf7->id();
    if ( $form_to_DB ) {
    $formData = $form_to_DB->get_posted_data();
    }

    This works fine and I can get the form field data out of $formData. However I am trying to get the data in the hidden field using $formData[‘ID’]
    This works fine if the ID field is NOT hidden but when hidden returns blank.

    I realise this is a little obscure but I have tried for a day to find a way round this.

    Thanks Paul

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Contact 7 form wpcf7_before_send_mail formdata omits hiddenen fields’ is closed to new replies.