Title: Redirect based on selection automatically
Last modified: March 7, 2024

---

# Redirect based on selection automatically

 *  Resolved [astreck2](https://wordpress.org/support/users/astreck2/)
 * (@astreck2)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/redirect-based-on-selection-automatically/)
 * Hi,
 * I’m trying to set up a form with 1 field – a dropdown selection. Ideally I’d 
   like as soon as a dropdown option is selected it will automatically redirect 
   to a page without having to hit the submit button.
 * Currently I have conditional logic set up as follows:
   Option 1 goes to page 1Option
   2 goes to page 2Option 3 goes to page 3and so on.
 * How I have it set up works – when I select an option and hit submit it redirects
   to the correct page based on my selection.
 * However, I’d like to remove the extra step of having to hit a button, is there
   a way that once an option is selected it will automatically redirect to a page?
   Not sure if this is possible.
 * Thanks,
   Ashley

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

 *  Plugin Support [Patrick – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport12/)
 * (@wpmudevsupport12)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/redirect-based-on-selection-automatically/#post-17484689)
 * Hi [@astreck2](https://wordpress.org/support/users/astreck2/)
 * I hope you are doing well,
 * We can use some JavaScript here but to make sure we are on the same page, you
   would like to skip all the submissions?
 * Best Regards
    Patrick Freitas
 *  Thread Starter [astreck2](https://wordpress.org/support/users/astreck2/)
 * (@astreck2)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/redirect-based-on-selection-automatically/#post-17485113)
 * Hi, yes that is correct. What Javascript would I add?
 *  [Kris – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport13/)
 * (@wpmudevsupport13)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/redirect-based-on-selection-automatically/#post-17490038)
 * Hi [@astreck2](https://wordpress.org/support/users/astreck2/)
 * I pinged our SLS Team to review this and see what will be possible in this case.
   We will post an update here as soon as more information is available.
 *  [Kris – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport13/)
 * (@wpmudevsupport13)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/redirect-based-on-selection-automatically/#post-17490524)
 * Hi again [@astreck2](https://wordpress.org/support/users/astreck2/)
 * This snippet should help as a mu-plugin:
 *     ```wp-block-code
       add_action( 'wp_footer', 'wpmudev_auto_submit_selction_form', 9999 );
       function wpmudev_auto_submit_selction_form() {
           global $post;
           if ( is_a( $post, 'WP_Post' ) && ! has_shortcode( $post->post_content, 'forminator_form' ) ) {
               return;
           }
           ?>
       	<script type="text/javascript">
       	jQuery(document).ready(function($) {
               setTimeout(function() {
       			$('.forminator-custom-form').trigger('after.load.forminator');
               }, 100);
   
               $(document).on('after.load.forminator', function(e, form_id) {
                   if ( e.target.id == 'forminator-module-1609' ) { // Please change the form ID.
                       $('#select-1 select').on('select2:select', function(ev) { 
       					$('#forminator-module-1609 .forminator-button-submit').trigger('click');
       				});
                   }
               });
           });
           </script>
           <?php
       }
       ```
   
 * Please note to change 1609 in forminator-module-1609 to your form ID, and #select-
   1 to your select ID.
 * He is a guide on how to install mu-plugin:
   [https://wpmudev.com/docs/using-wordpress/installing-wordpress-plugins/#installing-mu-plugins](https://wpmudev.com/docs/using-wordpress/installing-wordpress-plugins/#installing-mu-plugins)
 * Kind Regards,
   Kris
 *  Thread Starter [astreck2](https://wordpress.org/support/users/astreck2/)
 * (@astreck2)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/redirect-based-on-selection-automatically/#post-17495001)
 * Hi – it didn’t quite work for me, but I’ve decided to keep the button. Thanks!

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

The topic ‘Redirect based on selection automatically’ is closed to new replies.

 * ![](https://ps.w.org/forminator/assets/icon-256x256.gif?rev=3443182)
 * [Forminator Forms – Contact Form, Payment Form & Custom Form Builder](https://wordpress.org/plugins/forminator/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/forminator/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/forminator/)
 * [Active Topics](https://wordpress.org/support/plugin/forminator/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/forminator/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/forminator/reviews/)

## Tags

 * [conditional logic](https://wordpress.org/support/topic-tag/conditional-logic/)
 * [submit](https://wordpress.org/support/topic-tag/submit/)

 * 5 replies
 * 3 participants
 * Last reply from: [astreck2](https://wordpress.org/support/users/astreck2/)
 * Last activity: [2 years, 3 months ago](https://wordpress.org/support/topic/redirect-based-on-selection-automatically/#post-17495001)
 * Status: resolved