Quantcast
Channel: WordPress.org Forums » [Contact Form 7] Support
Viewing all articles
Browse latest Browse all 49500

Jake Love on "[Plugin: Contact Form 7] Grab success/failure from the front end"

$
0
0

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/


Viewing all articles
Browse latest Browse all 49500

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>