WordPress.org

Forums

Contact Form 7
Grab success/failure from the front end (1 post)

  1. Jake Love
    Member
    Posted 3 years ago #

    Is there a way that I can handle a successful send within my template? Is there some AJAX var that I can grab or is there any recommended methods?

    The goal would be to submit the form and a custom message comes up (really custom). The custom message would be set within that page template by a non-technical user (so it can't be a part of the actual contact form build process). I just need a solution I can tie to from the front-end that will help me process the event.

    Below is a ruff example of what I have so far. I would much rather do this in a more reliable fashion:

    <script>
    $(function(){
     $('#sidebarInner form').submit(function(){
        setTimeout(function(){
          var formState = $('#sidebarInner form').attr('class');
          console.log(formState);
        }, 1000);
     });
    });
    </script>

    I want the form to go away and the message to appear. I don't need help with any of the front end functionality - only a reliable method to grabbing the success/failure via JavaScript.

    Thanks,
    Jake

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

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