How do I use confirm_form()? I have a custom block made in the edit-mode of a node, and I would like to have it linked to a confirmation screen. So I figured out that I'll use confirm_form(). After a few days, I'm not able to get this function working. 

Is there anyone who can tell me what I do wrong or what I'm supposed to do?

This is the switch statement that defines my actions when hitting the button.

case ACTION_FICHE_OFFLINE : 
    if ($form_state['buttons']['5']['#value'] == ACTION_FICHE_ONLINE) {
      $form_state['values']['status'] = '1';
        drupal_set_message('FICHE ONLINE', 'warning', FALSE);
    }
    else {
      confirm_offline($form, 'Are you sure?', 'dashboard', t('This action cannot be undone'), 'Confirm', 'Cancel', 'fiche_offline');
      $form_state['values']['status'] = '0';
      drupal_set_message('FICHE OFFLINE', 'warning', FALSE);
}
    break;


The formal parameters for confirm_offline() are the following ones:


$form
$question
$path
$description = NULL
$yes
$no = NULL
$name = 'confirm'


What code should I use in confirm_offline()?
confirm_form() is a form builder; as such it should be called from a menu callback or another form builder function. From the code you shown, I take you are calling it from a form submission handler, and that is not how you should use that function.

As example of code that shows a confirmation form, you can look at system_modules(), the form builder associated with the "admin/modules" path. The function contains the following code.

  // If the modules form was submitted, then system_modules_submit() runs first
  // and if there are unfilled required modules, then $form_state['storage'] is
  // filled, triggering a rebuild. In this case we need to display a
  // confirmation form.
  if (!empty($form_state['storage'])) {
    return system_modules_confirm_form($visible_files, $form_state['storage']);
  }


The form submission handler for the "admin/modules" path, system_modules_submit(), then contains the following code.

  // Redirects to confirmation form if more modules need to be enabled.
  if ((!empty($more_required) || !empty($missing_modules)) &amp;&amp; !isset($form_state['values']['confirm'])) {
    $form_state['storage'] = array(
      'more_required' =&gt; $more_required, 
      'modules' =&gt; $modules, 
      'missing_modules' =&gt; $missing_modules,
    );
    $form_state['rebuild'] = TRUE;
    return;
  }


Settings $form_state['rebuild'] to TRUE tells Drupal to call again the form builder which (basing on the value of $form_state['storage']) shows the confirmation form, rather than the form listing all the modules found for the Drupal site.