Cascading dropdown select search based on Parent Page & Child Page

How would I create a cascading dropdown select search where the first dropdown would host selected Parent Pages and the second to display the Child Pages of the selected Parent. When submit button is clicked it would just redirect to the selected child page.

Could anyone please help me on how to get this done, I've done the research and haven't gotten anywhere apart from only displaying all specific Parent pages that's needed in 1 dropdown using the code below:

li id=pages
    h2?php _e('pages:'); ?/h2
    form action=?php bloginfo('url'); ? method=get
        ?php wp_dropdown_pages( array(
          'include' = array( 119, 467, 857, 1027, 404 ), // Array of page IDs to include.
        ) ); ?
    input type=submit name=submit value=view /
    /form
/li

Topic php forms pages html Wordpress javascript

Category Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.