Title: Problem with submit button
Last modified: July 2, 2020

---

# Problem with submit button

 *  Resolved [alejandroloto](https://wordpress.org/support/users/alejandroloto/)
 * (@alejandroloto)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/problem-with-submit-button-2/)
 * I am using the plugin for my website with the idea that depending on the response
   that the user chooses, a submit button will appear that redirects you to one 
   url or another. But I don’t know how to add the redirection via url to each button.
   And when a button appears and I click it doesn’t send anything. What could it
   be? Please help.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fproblem-with-submit-button-2%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Jules Colle](https://wordpress.org/support/users/jules-colle/)
 * (@jules-colle)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/problem-with-submit-button-2/#post-13062467)
 * The plugin is not intended to work like that. But there are ways to do this. 
   The solution depends on what you need.
 * If you just want to use the form to redirect people to another page without actually
   submitting the form, you could just add some links in the groups and style them
   as buttons.
 * If you do need to process the form and additionally redirect conditionally, you
   could write your form like this:
 *     ```
       [radio redirect "redirect to google.com" "redirect to example.com"]
       [group google][submit "Submit and redirect to Google"][/group]
       [group example][submit "Submit and redirect to example"][/group]
       <script>
       document.addEventListener( 'wpcf7mailsent', function( event ) {
         if(jQuery('[data-id="google"]').is(':visible')) {
           location = 'https://google.com'
         } else if (jQuery('[data-id=example]').is(':visible')) {
           location = 'http://example.com/';
         }
       }, false );
       </script>
       ```
   
 * Then add these conditions:
 *     ```
       show [google] if [redirect] equals "redirect to google.com"
       show [example] if [redirect] equals "redirect to example.com"
       ```
   
 * I’ve set up a temporary link to illustrate this.
    [https://conditional-fields-cf7.bdwm.be/form-tester/?hash=fc859dbd45d0d78c89a06526560803c9](https://conditional-fields-cf7.bdwm.be/form-tester/?hash=fc859dbd45d0d78c89a06526560803c9)
   Note that the form tester does not actually send emails, so i changed `wpcf7mailsent`
   to `wpcf7mailfailed`. If you copy code form here, make sure to change it back
   to `wpcf7mailsent`
 * Note that the last solution is kind of an anti-pattern, because you are assuming
   that people will submit the form by clicking a button. If they submit the form
   by pressing Enter, without first showing a group, no redirect will happen.
 *  Plugin Author [Jules Colle](https://wordpress.org/support/users/jules-colle/)
 * (@jules-colle)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/problem-with-submit-button-2/#post-13147616)
 * I’ve dedicated a page to this: [https://conditional-fields-cf7.bdwm.be/conditional-redirect/](https://conditional-fields-cf7.bdwm.be/conditional-redirect/)

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Problem with submit button’ is closed to new replies.

 * ![](https://ps.w.org/cf7-conditional-fields/assets/icon-256x256.png?rev=2072595)
 * [Conditional Fields for Contact Form 7](https://wordpress.org/plugins/cf7-conditional-fields/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/cf7-conditional-fields/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/cf7-conditional-fields/)
 * [Active Topics](https://wordpress.org/support/plugin/cf7-conditional-fields/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/cf7-conditional-fields/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/cf7-conditional-fields/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Jules Colle](https://wordpress.org/support/users/jules-colle/)
 * Last activity: [5 years, 10 months ago](https://wordpress.org/support/topic/problem-with-submit-button-2/#post-13147616)
 * Status: resolved