Title: wp_dropdown_pages &#8211; without the submit button?
Last modified: August 19, 2016

---

# wp_dropdown_pages – without the submit button?

 *  [aymate](https://wordpress.org/support/users/aymate/)
 * (@aymate)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/wp_dropdown_pages-without-the-submit-button/)
 * [http://codex.wordpress.org/Function_Reference/wp_dropdown_pages](http://codex.wordpress.org/Function_Reference/wp_dropdown_pages)
   gives an example that includes a submit button. How would I go about implimenting
   this in a way that didnt rely on a submit button to trigger the link?
 * Cheers

Viewing 1 replies (of 1 total)

 *  [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * (@t31os_)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/wp_dropdown_pages-without-the-submit-button/#post-1610287)
 * In a similar way to the dropdown category widget?
 *     ```
       <?php wp_dropdown_pages(); ?>
       <script type='text/javascript'>
       /* <![CDATA[ */
       	var dropdown = document.getElementById("page_id");
       	function onPageChange() {
       		if ( dropdown.options[dropdown.selectedIndex].value > 0 ) {
       			location.href = "<?php echo home_url(); ?>/?page_id="+dropdown.options[dropdown.selectedIndex].value;
       		}
       	}
       	dropdown.onchange = onPageChange;
       /* ]]> */
       </script>
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘wp_dropdown_pages – without the submit button?’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * Last activity: [15 years, 9 months ago](https://wordpress.org/support/topic/wp_dropdown_pages-without-the-submit-button/#post-1610287)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
