Getting the selected option value of a radio button in form_state storage I'm trying to make a step form which redirects to a special form depending on a radio button option chosen by the user.

My form always go to the default option value. I think I'm doing it wrong with the $form_state['storage'] getting the selected option.

function multiform_second_form(&amp;$form, &amp;$form_state) {
  $values = $form_state['values'];
  $form_state['rebuild'] = TRUE;

  $options = array(
  '0' =&gt; t('Simple'),
  '1' =&gt; t('Multiple'), 
  '2' =&gt; t('Custom'),
);

  $form['qtype'] = array(
  '#type' =&gt; 'radios',
  '#title' =&gt; t('question'),
  '#options' =&gt; $options,
  '#description' =&gt; t('Chose a question type.'),
  '#default_value' =&gt; $options['0'],
);

  $option_value = $form['qtype']['options'];    
  $form_state['storage'] = array(
      'qtype' =&gt; $option_value,
    );  

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

  $form['#submit'][] = 'multiform_second_form_submit';

  return $form;
}



function multiform_second_form_submit($form, &amp;$form_state) {
  $values = $form_state['values'];
  $form_state['rebuild'] = TRUE;

  if (isset($values['next']) &amp;&amp; $values['op'] == $values['next']) {

  switch ($form_state['storage']['qtype']) {
    case 0:
    $form_state['storage']['step'] = 'multiform_qsimple_form';
    break;
    case 1:
    $form_state['storage']['step'] = 'multiform_qmultiple_form';
    break;
    case 2:
    $form_state['storage']['step'] = 'multiform_qcustom_form';
    break;
}

  }
}


If somebody can give me some advices, it would be really great !
Try using a string for the step id, something like this:

function multiform_second_form(&amp;$form, &amp;$form_state) {
  $values = $form_state['values'];
  $form_state['rebuild'] = TRUE;

  $options = array(
  'simple' =&gt; t('Simple'),
  'multiple' =&gt; t('Multiple'), 
  'custom' =&gt; t('Custom'),
  );

  $form['qtype'] = array(
  '#type' =&gt; 'radios',
  '#title' =&gt; t('question'),
  '#options' =&gt; $options,
  '#description' =&gt; t('Chose a question type.'),
  '#default_value' =&gt; 'simple',
  );

  $option_value = isset($form_state['values']['qtype']) ? $form_state['values']['qtype'] : 'simple';    
  $form_state['storage'] = array(
    'qtype' =&gt; $option_value,
  );  

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

  $form['#submit'][] = 'multiform_second_form_submit';

  return $form;
}



function multiform_second_form_submit($form, &amp;$form_state) {
  $values = $form_state['values'];
  $form_state['rebuild'] = TRUE;

  if (isset($values['next']) &amp;&amp; $values['op'] == $values['next']) {

  switch ($form_state['storage']['qtype']) {
    case 'simple':
    $form_state['storage']['step'] = 'multiform_qsimple_form';
    break;
    case 'multiple':
    $form_state['storage']['step'] = 'multiform_qmultiple_form';
    break;
    case 'custom':
    $form_state['storage']['step'] = 'multiform_qcustom_form';
    break;
  }

  }
}