Form submit to page with another Form I am trying to make a submission from one page that has a form to another dynamic page with a form. As you can see in my hook menu I'm using drupal_get_form as the callback and I would think this would normally work, since I am able to go to the 1st form just fine without any problems.

I do notice I get this error when I submit to the URL, the page is simply not rendering the 2nd form or the contents I have in the function that is suppose to display in the mark up of the 2nd form.

This is the error I get

Notice: Undefined index: listings_mini_form in drupal_retrieve_form() (line 764 of /home/domain/public_html/includes/form.inc).
Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'listings_mini_form' not found or invalid function name in drupal_retrieve_form() (line 799 of /home/domain/public_html/includes/form.inc)


This is not a multiform rather it is 2 different pages with their own forms.

Any suggestions?

/**
 * Implements hook_menu().
 */
function listings_menu() {
    $items = array();

    $items['site/listings'] = array(
        'title' =&gt; 'State Listings',
        'page callback' =&gt; 'drupal_get_form',
        'page arguments' =&gt; array('listings_form'),
        'access arguments' =&gt; array('access content'),
    );

    $items['site/listings/%/%'] = array(
        'title' =&gt; 'Business Listings',
        'page callback' =&gt; 'drupal_get_form',
        'page arguments' =&gt; array('listings_mini_form'),
        'access arguments' =&gt; array('access content')
    );

    return $items; 

}

/*
 *  FIRST FORM
 */

function listings_form($form, &amp;$form_state){

    $form['zipcode'] = array(
        '#title' =&gt; t('Zipcode'),
        '#type' =&gt; 'textfield',
        '#maxlength' =&gt; 5,
    );

    $form['form-wrapper']['form-wrapper-zip']['submit'] = array(
        '#type' =&gt; 'submit',
        '#value' =&gt;  t('Submit')
    );

    return $form;
}


/*
 *  FIRST FORM SUBMIT FUNCTION
 */

function listings_form_submit($form, &amp;$form_state){

    $zipcode = $form_state['values']['zipcode'];

    $form_state['redirect'] = 'site/listings/'.strtolower(listings_db_state($zipcode)).'/'.strtolower(str_replace(' ', '+', listing_db_city($zipcode)));
}


/*
 *  2ND FORM ON PAGE IM CALLING
 */

function listings_mini_form($form, &amp;$form_state){

    $form['mini-form'] =  array(
        '#title' =&gt; t('Enter your Zip Code for more listings.'),
        '#type' =&gt; 'textfield',
        '#maxlength' =&gt; 5,
    );

    $form['submit'] = array(
        '#type' =&gt; 'submit',
        '#value' =&gt;  t('Submit')
    );

    if(isset($form_state['values'])){
        $form['page_output'] = array(
            '#markup' =&gt; listings_list_view($form, $form_state)
        );
    }

}

/*
 *  2ND FORM SUBMIT FUNCTION
 */


function listings_mini_form_submit($form, &amp;$form_state){

    $zipcode = $form_state['values']['zipcode'];

    $form_state['redirect'] = 'site/listings/'.strtolower(listings_db_state($zipcode)).'/'.strtolower(str_replace(' ', '+', listing_db_city($zipcode)));
}


/* 
 *  FUNCTION WITH LISTINGS INSIDE OF IT 
 */


function listings_list_view($form, &amp;$form_state){

    global $base_url;

    $zipcode = isset($form_state['values']['zipcode']);
     dpr($zipcode);

     #blah blah blah    
}
Use this code, your missing $return $form in the second form


    /**
     * Implements hook_menu().
     */
    function listings_menu() {
        $items = array();
        $items['site/listings'] = array(
            'title' => 'State Listings',
            'page callback' => 'drupal_get_form',
            'page arguments' => array('listings_form'),
            'access arguments' => array('access content'),
        );

        $items['site/listings/%/%'] = array(
            'title' => 'Business Listings',
            'page callback' => 'drupal_get_form',
            'page arguments' => array('listings_mini_form'),
            'access arguments' => array('access content')
        );

        return $items;
    }

    /*
     *  FIRST FORM
     */

    function listings_form($form, &$form_state) {

        $form['zipcode'] = array(
            '#title' => t('Zipcode'),
            '#type' => 'textfield',
            '#maxlength' => 5,
        );

        $form['form-wrapper']['form-wrapper-zip']['submit'] = array(
            '#type' => 'submit',
            '#value' => t('Submit')
        );

        return $form;
    }

    /*
     *  FIRST FORM SUBMIT FUNCTION
     */

    function listings_form_submit($form, &$form_state) {

        $zipcode = $form_state['values']['zipcode'];

        $form_state['redirect'] = 'site/listings/' . strtolower(listings_db_state($zipcode)) . '/' . strtolower(str_replace(' ', '+', listing_db_city($zipcode)));
    }

    /*
     *  2ND FORM ON PAGE IM CALLING
     */

    function listings_mini_form($form, &$form_state) {

        $form['mini-form'] = array(
            '#title' => t('Enter your Zip Code for more listings.'),
            '#type' => 'textfield',
            '#maxlength' => 5,
        );

        $form['submit'] = array(
            '#type' => 'submit',
            '#value' => t('Submit')
        );

        if (isset($form_state['values'])) {
            $form['page_output'] = array(
                '#markup' => listings_list_view($form, $form_state)
            );
        }
        return $form;
    }

    /*
     *  2ND FORM SUBMIT FUNCTION
     */

    function listings_mini_form_submit($form, &$form_state) {
        $zipcode = $form_state['values']['zipcode'];
        $form_state['redirect'] = 'site/listings/' . strtolower(listings_db_state($zipcode)) . '/' . strtolower(str_replace(' ', '+', listing_db_city($zipcode)));
    }

    /*
     *  FUNCTION WITH LISTINGS INSIDE OF IT 
     */

    function listings_list_view($form, &$form_state) {
        global $base_url;
        $zipcode = isset($form_state['values']['zipcode']);
        dpr($zipcode);
        #blah blah blah    
    }


I got output using this code


    /*
     *  FIRST FORM
     */

    function listings_form($form, &$form_state) {
        $form['zipcode'] = array(
            '#title' => t('Zipcode'),
            '#type' => 'textfield',
            '#maxlength' => 5,
        );

        $form['form-wrapper']['form-wrapper-zip']['submit'] = array(
            '#type' => 'submit',
            '#value' => t('Submit')
        );

        return $form;
    }

    /*
     *  FIRST FORM SUBMIT FUNCTION
     */

    function listings_form_submit($form, &$form_state) {
        $zipcode = $form_state['values']['zipcode'];
        $form_state['redirect'] = 'site/listings/' . $zipcode . '/' . $zipcode;
    }

    /*
     *  2ND FORM ON PAGE IM CALLING
     */

    function listings_mini_form($form, &$form_state) {
        $form = array();
        $form['mini-form'] = array(
            '#title' => t('Enter your Zip Code for more listings.'),
            '#type' => 'textfield',
            '#maxlength' => 5,
        );

        $form['submit'] = array(
            '#type' => 'submit',
            '#value' => t('Submit')
        );

        if (isset($form_state['values'])) {
            $form['page_output'] = array(
                '#markup' => listings_list_view($form, $form_state)
            );
        }
        return $form;
    }

    /*
     *  2ND FORM SUBMIT FUNCTION
     */

    function listings_mini_form_submit($form, &$form_state) {
        $zipcode = $form_state['values']['zipcode'];
        $form_state['redirect'] = 'site/listings/' . strtolower(listings_db_state($zipcode)) . '/' . strtolower(str_replace(' ', '+', listing_db_city($zipcode)));
    }

    /*
     *  FUNCTION WITH LISTINGS INSIDE OF IT 
     */

    function listings_list_view($form, &$form_state) {
        $zipcode = isset($form_state['values']['zipcode']);
    }