0

I have this page

link

In this page you will find a button called "get a quote".When I click on this button I want to go to google.com.

To do this, I tried the following code.

jQuery(function($) {
    $(".wpcf7-form-control.wpcf7-submit").click(function() {
        window.location = "www.google.com/index.php?id=";
    });
});

Unfortunately when someone clicks the button, the link appears this form.

http://dgprint.dg-site.com/www.google.com/?id=

Can anyone tell me why not work? The site is made with Wordpress plugin and used the "Contact form 7"

Thanks in advance!

EDIT:

<div class="contact-frm">
        <div class="right">
            <?php echo do_shortcode('[contact-form-7 id="9" title="get a quote"]'); ?>
        </div>
    </div>

EDIT2:

<p><input type="submit" value="get a quote" class="wpcf7-form-control wpcf7-submit"><img class="ajax-loader" src="http://dgprint.dg-site.com/wp-content/plugins/contact-form-7/images/ajax-loader.gif" alt="Sending ..." draggable="false" style="visibility: hidden;"></p>
Gigi
  • 29
  • 3

1 Answers1

1

Use this way:

jQuery(document).ready(function($) {
    $('.wpcf7-form-control .wpcf7-submit').click(function() {
        window.location = "http://www.google.com/index.php?id=" + $(this).attr("id");
// ------------------------------------------------------------^^^^
    });
});
Praveen Kumar Purushothaman
  • 164,888
  • 24
  • 203
  • 252