CF7 Redirection on Submission
- سُلَيْمَان بْن دَاوُوْد

- 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.
Comments