Title: Conditional redirect based on form content?
Last modified: May 11, 2018

---

# Conditional redirect based on form content?

 *  Resolved [gibbie99](https://wordpress.org/support/users/gibbie99/)
 * (@gibbie99)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/conditional-redirect-based-on-form-content/)
 * I found this link:
 * [https://wordpress.org/support/topic/using-redirect-script-different-thank-you-pages-based-on-form/](https://wordpress.org/support/topic/using-redirect-script-different-thank-you-pages-based-on-form/)
 * Which is a conditional redirect based on form ID.
 * Is it possible to do a conditional redirect based on submitted data?
 * Basically consider a form with 1 question with two radioboxes. Do you like Fruit.
   Y/N. N redirects to “you-dont-like-fruit’ and Y redirects to ‘you-like-fruit’
   page.
 * Would this be in the event data?

Viewing 1 replies (of 1 total)

 *  Thread Starter [gibbie99](https://wordpress.org/support/users/gibbie99/)
 * (@gibbie99)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/conditional-redirect-based-on-form-content/#post-10282343)
 * Update: We found the solution. Adding this script below the form works.
 * <script>
    document.addEventListener( ‘wpcf7mailsent’, function( event ) { if(
   event.detail.inputs[0].value == ‘test’){ location = ‘[https://www.xxx.com/thank-you-for-your-submission/&#8217](https://www.xxx.com/thank-you-for-your-submission/&#8217);;}
   else{ location = ‘[https://www.xxx.com/schedule-a-demo-3/&#8217](https://www.xxx.com/schedule-a-demo-3/&#8217);;}},
   false ); </script>

Viewing 1 replies (of 1 total)

The topic ‘Conditional redirect based on form content?’ is closed to new replies.

 * ![](https://ps.w.org/contact-form-7/assets/icon.svg?rev=2339255)
 * [Contact Form 7](https://wordpress.org/plugins/contact-form-7/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contact-form-7/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contact-form-7/)
 * [Active Topics](https://wordpress.org/support/plugin/contact-form-7/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contact-form-7/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contact-form-7/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [gibbie99](https://wordpress.org/support/users/gibbie99/)
 * Last activity: [8 years, 2 months ago](https://wordpress.org/support/topic/conditional-redirect-based-on-form-content/#post-10282343)
 * Status: resolved