Forums

Contact Form 7
[resolved] redirects based on radio button selection (3 posts)

  1. kremisoski
    Member
    Posted 5 months ago #

    I was wondering if there is a way to customize the submit button in a way that depending on which radio button is selected after the message sends it will send you to a different redirect.

    http://wordpress.org/extend/plugins/contact-form-7/

  2. kremisoski
    Member
    Posted 5 months ago #

    I tried this, and added it to header.php as well as added an additional parameter to the plugin settings. Unfortunately, it's working fine locally, but not online. Any suggestions?

    <script>
    function my_redirect() {
    var url;
    var radioButton = $('input[name=test]:checked', '#radio1').val();
    if ( radioButton == 'Facebook' ) {
    url = 'http://www.facebook.com';
    }
    else if ( radioButton == 'Twitter' ) {
    url = 'http://www.twitter.com';
    }
    else {
    url = 'http://www.youtube.com';
    }
    window.location = url;
    return false;
    }
    </script>

  3. kremisoski
    Member
    Posted 5 months ago #

    Sorry for the triple post, but I was mistaken. It works fine as long as the theme is well structured. I've tested it both online and locally with Twenty Eleven. :)

Reply

You must log in to post.

About this Plugin

About this Topic