top of page

CF7 Redirection on Submission

  • Writer: سُلَيْمَان بْن دَاوُوْد
    سُلَيْمَان بْن دَاوُوْد
  • Jun 17, 2021
  • 1 min read

CF7 Provide a script for redirection as below



<script>

	document.addEventListener( 'wpcf7mailsent', function( event ) {
			setCookie('user_cookied','yes',30);

	  		console.log('user cookied');

			if(event.detail.contactFormId == '21653'){

				jQuery('#whitepapercookie').hide();

				var sharpurl = jQuery('#sharpwhitepaperurl').val();

				window.location.href = sharpurl;
			}


	}, false );
	</script>



PROPERTY                      DESCRIPTION
detail.contactFormId          The ID of the contact form.
detail.pluginVersion          The version of Contact Form 7 plugin.
detail.contactFormLocale      The locale code of the contact form.
detail.unitTag                The unit-tag of the contact form.
detail.containerPostId        The ID of the post that the contact form is placed in.



  • wpcf7invalid — Fires when an Ajax form submission has completed successfully, but mail hasn’t been sent because there are fields with invalid input.

  • wpcf7spam — Fires when an Ajax form submission has completed successfully, but mail hasn’t been sent because a possible spam activity has been detected.

  • wpcf7mailsent — Fires when an Ajax form submission has completed successfully, and mail has been sent.

  • wpcf7mailfailed — Fires when an Ajax form submission has completed successfully, but it has failed in sending mail.

  • wpcf7submit — Fires when an Ajax form submission has completed successfully, regardless of other incidents.


 
 
 

Recent Posts

See All
Duplicate Category in Wordpress

The following code helps to duplicate the default wordpress category by help of code. // Add Duplicate option for categories in WordPress...

 
 
 
C#.NET and Its Associated Codes

1- Creating an Desktop Application in C#.NET C# ADO.NET & MySQL MAIN C# and MySQL ADO.NET with Crystals Reports Ready Code 2- Handling...

 
 
 

Comments


© 2020 by syednazrulhassan

bottom of page