How to call template when Custom form is submitted? I have created custom form and on submit of that form, I need to fetch data from database and need to display that content in well structured format in different template.

I am able to create form, on submission, I am able to fetch data from database but I am not able to pass that result to another template and display data on that template. I have also tried with

 function nexposed_menu() {
  $items = array();

  $items['form-example'] = array(
    'title' =&gt; 'Example Form',
    'description' =&gt; 'A form to mess around with.',
    'page callback' =&gt; 'drupal_get_form',
    'page arguments' =&gt; array('nexposed_form'),
    'access callback' =&gt; TRUE
  );
  return $items;
}

function nexposed_form($form, &amp;$form_state) {
  $toppings = array(
    'Jan' =&gt; t('Jan'),
    'Feb' =&gt; t('Feb'),
    'Mar' =&gt; t('Mar')
  );

  $form['month'] = array(
    '#title' =&gt; t('Months'),
    '#type' =&gt; 'checkboxes',
    '#description' =&gt; t('Select the Month'),
    '#options' =&gt; $toppings,
  );
  $form['submit_button'] = array(
    '#type' =&gt; 'submit',
    '#value' =&gt; t('Click Here!'),
  );

  return $form;
}

function nexposed_form_validate($form, &amp;$form_state) {
}

function nexposed_form_submit($form, &amp;$form_state) {
  drupal_set_message(t('Search submitted successfully.'));
  $query = db_select('node', 'node');
  $query = $query-&gt;fields('node', array('nid', 'title'));
  $query-&gt;condition('node.type', 'events'); 
  $rows = $query-&gt;execute()-&gt;fetchAll(PDO::FETCH_ASSOC);

  return theme('event_page', array('data' =&gt; $result, 'paging' =&gt; $paging));
}


Where $result contains data in the key value pair format, but that template is not called rather no result is displayed.

Any help regarding this is highly appreciated. Thanks in advance.
Please update your _menu function with this code.

  function filterevents_menu() {
  $items = array();

    $items['events-filter'] = array(
        'title' =&gt; 'Events Listing',
        'description' =&gt; '',
        'page callback' =&gt; drupal_get_form,
          'page arguments' =&gt; array('filterevents_form'), 
        'access callback' =&gt; TRUE,
    );
    return $items;
  }


And then clear drupal cache. Hope it will work.

Thanks.