Title: How configure multiple dropdown with submit button
Last modified: August 21, 2016

---

# How configure multiple dropdown with submit button

 *  Resolved [crokis](https://wordpress.org/support/users/crokis/)
 * (@crokis)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/how-configure-multiple-dropdown-with-submit-button/)
 * Hello people.
 * I hope so that somebody can help me, please.
 * I configured a dropdown with a submit button.
    Code here:
 *     ```
       <h2><?php _e('Categories:'); ?></h2><br>
       	<form action="<?php bloginfo('url'); ?>" method="get">
       	<div>
       	<?php wp_dropdown_categories('show_option_none=Selecciona el tipo&child_of=7'); ?>
       	<?php wp_dropdown_categories('show_option_none=Selecciona el producto&child_of=6'); ?>
       	<br>
       	<input type="submit" name="submit" value="view" />
       	</div>
       	</form>
       ```
   
 * But, just show me results of a category.
 * i would like have 3 dropdown that show the child categories and work with a single
   submit button
 * Anybody can help me, please?
    Thanks.

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

 *  [vtxyzzy](https://wordpress.org/support/users/vtxyzzy/)
 * (@vtxyzzy)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/how-configure-multiple-dropdown-with-submit-button/#post-4168933)
 * I did not know the name of your third category, so I created this code with two
   dropdowns. You should be able to add the third yourself.
 *     ```
       <script type="text/javascript">
       //<![CDATA[
   
          function validateForm() {
             var tipo = document.getElementById('tipo').value;
             var producto = document.getElementById('producto').value;
   
             var catForm = document.getElementById('catForm'); // retrieve form
             catForm.action = catForm.action + '?cat=' + tipo + ',' + producto; // add cat parameter
   
             var retval = true;
             retval = confirm("action=" + catForm.action);  // For testing, comment out for production
   
             return retval;
       }
   
       //]]>
       </script>
       <h2><?php _e('Categories:'); ?></h2><br>
       <form id="catForm" action="<?php bloginfo('url'); ?>" method="post"
          onSubmit="return validateForm();">
          <div>
             <?php wp_dropdown_categories('show_option_none=Selecciona el tipo&child_of=78&id=tipo&name=tipo'); ?>
             <?php wp_dropdown_categories('show_option_none=Selecciona el producto&child_of=65&id=producto&name=producto'); ?>
             <br>
             <input type="submit" id="sub" name="submit" value="view" />
          </div>
       </form>
       ```
   
 *  Thread Starter [crokis](https://wordpress.org/support/users/crokis/)
 * (@crokis)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/how-configure-multiple-dropdown-with-submit-button/#post-4168934)
 * Hello vtxyzzy.
 * Thank you so much!!!! Your code really helped me a lot.
    I can see now that javascript
   function, did all work.
 * I began work on my first theme with WP codex, therefore i learned something new
   with your help.
 * Regards!

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

The topic ‘How configure multiple dropdown with submit button’ is closed to new 
replies.

## Tags

 * [categories](https://wordpress.org/support/topic-tag/categories/)
 * [dropdown](https://wordpress.org/support/topic-tag/dropdown/)
 * [multiple](https://wordpress.org/support/topic-tag/multiple/)
 * [submit](https://wordpress.org/support/topic-tag/submit/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [crokis](https://wordpress.org/support/users/crokis/)
 * Last activity: [12 years, 8 months ago](https://wordpress.org/support/topic/how-configure-multiple-dropdown-with-submit-button/#post-4168934)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
