How do I a use a template file to theme a mulit-step form? I am creating a multi step form, and displaying that through a template file. The first step of the form displays fine, but when I go to the second step, the first step titles are also displaying.

How can I check which form fields are displayed? The form fields for the first step should not appear when the second-step form fields are shown.
The first thing to do is to save the current step to an element in your form:

$form['step'] = array
(
  '#type' =&gt; 'value',
  '#value' =&gt; $form_state['step'], // or however you are storing the step
);


Then, in the preprocess function form your template, you can turn this into a variable that can be used:

function THEME_preprocess_THEMEKEY(&amp;$vars)
{
  $form = $vars['form'];
  // This sets up the variable
  $vars['step'] = $form['step']['#value'];
}


Now, in your template you will have a $step variable available that you can use for choosing which elements to output:

&lt;?php if ($step == 1): ?&gt;
  // output step 1 fields here
&lt;?php elseif ($step == 2): ?&gt;
  // output step 2 fields here
&lt;?php endif; ?&gt;