title: Custom taxonomies Dropdown without a Submit Button using JavaScript
body: <p>I Developing one project and I stuck in small thing which is very small for PHP Expert :D Which i'm not</p>
  
  <p>I'm Trying to make Dropdown list of Custom taxonomies which work on select go to that Custom taxonomies page.</p>
  
  <p>But After lot of search I found Solution But not doing action to go to the selected Custom taxonomies</p>
  
  <p>First I found</p>
  
  <pre><code>&lt;?php wp_dropdown_categories( 'taxonomy=my_custom_taxonomy' ); ?&gt;
  </code></pre>
  
  <p>Second I found</p>
  
  <pre><code>function fjarrett_custom_taxonomy_dropdown( $taxonomy ) {
  $terms = get_terms( $taxonomy );
  if ( $terms ) {
      printf( '&lt;select name="%s" class="postform"&gt;', esc_attr( $taxonomy ) );
      foreach ( $terms as $term ) {
          printf( '&lt;option value="%s"&gt;%s&lt;/option&gt;', esc_attr( $term-&gt;slug ), esc_html( $term-&gt;name ) );
      }
      print( '&lt;/select&gt;' );
  }
  }
  </code></pre>
  
  <p>Which I can use when I insert in any page code billow</p>
  
  <pre><code>&lt;?php fjarrett_custom_taxonomy_dropdown( 'my_custom_taxonomy' ); ?&gt;
  </code></pre>
  
  <blockquote>
    <p>Credit
    <a href="https://frankiejarrett.com/2011/09/create-a-dropdown-of-custom-taxonomies-in-wordpress-the-easy-way/" rel="nofollow noreferrer">https://frankiejarrett.com/2011/09/create-a-dropdown-of-custom-taxonomies-in-wordpress-the-easy-way/</a></p>
  </blockquote>
  
  <p>BUT I DON'T KNOW NOW HOW I GONNA MAKE IT WORKING</p>
  
  <p>Hope you can help me to find solution that from above any one solution can I able to make select and go thing.</p>
  
  <hr>
  
  <p>Thanks in advance</p>
  
  <h2>POSSIBLE ANSWER - 1</h2>
  
  <p>I Found Possible Answer</p>
  
  <pre><code>&lt;form id="category-select" class="category-select" action="&lt;?php echo esc_url( home_url( '/' ) ); ?&gt;" method="get"&gt;
  
      &lt;?php
      $args = array(
          'show_option_none' =&gt; __( 'Select category' ),
          'show_count'       =&gt; 1,
          'orderby'          =&gt; 'name',
          'name'             =&gt; 'cat',
          'echo'             =&gt; 0,
          'taxonomy'         =&gt; 'MyCustomTaxonomys',
          'value_field'      =&gt; 'slug'
      );
      ?&gt;
  
      &lt;?php $select  = wp_dropdown_categories( $args ); ?&gt;
      &lt;?php $replace = "&lt;select$1 onchange='return this.form.submit()'&gt;"; ?&gt;
      &lt;?php $select  = preg_replace( '#&lt;select([^&gt;]*)&gt;#', $replace, $select ); ?&gt;
  
      &lt;?php echo $select; ?&gt;
  
      &lt;noscript&gt;
          &lt;input type="submit" value="View" /&gt;
      &lt;/noscript&gt;
  
  &lt;/form&gt;
  </code></pre>
  
  <p>It Give me URL </p>
  
  <blockquote>
    <p>www.website.com/?cat=xxx  where xxx is my custom taxonomy</p>
  </blockquote>
  
  <p>But I Want URL </p>
  
  <blockquote>
    <p>www.website.com/cat/xxx  where xxx is my custom taxonomy</p>
  </blockquote>
  
  <p>Is it possible? </p>