Hello,
You can try something similar to the following (Untested!) code:
<select name="page-dropdown"
onchange='document.location.href=this.options[this.selectedIndex].value;'>
<option value="">
<?php echo esc_attr( __( 'Select page' ) ); ?></option>
<?php
$pages = get_pages();
foreach ( $pages as $page ) {
$option = '<option value="' . get_page_link( $page->ID ) . '">';
$option .= $page->post_title;
$option .= '</option>';
echo $option;
}
?>
</select>
The above will get you all pages and upon selection send you to that page. To only show certain pages in this list just add in some arguments into:
$pages = get_pages($args);
Here you can list pages by page ID:
'page_id' => 7
or page slug:
'pagename' => 'contact'
As for the submit button, what are you trying to achieve? Redirecting a user as soon as they’ve selected a page from the dropdown would mean less clicks than having to click ‘submit’ to go the page after selection.
~ Steven