Contact Form 7
Get value radio button and set additional setting (1 post)

  1. Fallensoul99
    Posted 2 years ago #

    New update *Head-bang* ! Documentation is terse.

    Question 1: How do I get the value from the radio button.

    This is my functions.php

    add_action ('wpcf7_before_send_mail','wpcf7_redirect');
    function wpcf7_redirect ($wpcf7) {
    $submission = WPCF7_Submission::get_instance();
    if ( $submission ) {
    $form_data = $submission->get_posted_data();
    $language = reset($form_data['radio-946']);

    I have to use reset to get the first value from the array. It should just give me the value right? Anyway this currently works but it seems wrong.

    This works for me if people are pulling their hair out trying to redirect:

    $url = "on_sent_ok: \"location = 'http://www.google.com';\"";
    $wpcf7->set_properties(array ('additional_settings' => $url));


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Contact Form 7
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.