hook_form being called twice I have a simple form inside a block:

function mymodule_block_view($delta = '') {
      switch($delta) {
        case 'some_name':

          $block['subject'] = t('title');
          $block['content'] = drupal_get_form('mymodule_form');
      }
      return $block;
    }


When I submit the form, the mymodule_form() method gets called twice. In the first run the values I have put into the textfields are correctly stored in $form_state. In the second run, they are not there anymore. Does anyone have an idea why this is the case?

What I would like to do is very simple: I'd like to retain the values I have put into the textfields, so when the form gets submitted, the page gets reloaded, and the values I gave are the new default_values of the form. I know how to do this in the code, but as I said, the form_state is empty in the second run, thus the form takes the 'default' default_values.

Why does mymodule_form() get called twice?
Drupal redirects after form submissions. So you are effectively making two requests, one for the form submission and one as a consequence of the redirect.

See Wikipedia: Post/Redirect/Get for details about why Drupal redirects after form submissions.

Set $form_state['redirect'] = false to prevent redirection.