Form selection with radios, ajax and taxonomy terms In my form i get the message: "An illegal choice has been detected. Please contact the site administrator." after i didn't select a radio box in the 2nd form. How can i avoid this? NULL doesn´t work and key($type_2) works only for the first call. If I changed the selection in the first form I must select a radio box in the 2nd form. If I don't do this, the message comes and I can`t change the selection of the 1st form ... hope I could it little bit explain.

  $default = isset($input) ? $input : NULL;
  $form['step_2']['options']['type'] = array (
    '#title' =&gt; t('Types 1'),
    '#type' =&gt; 'radios',
    '#options' =&gt; $type, //get the array from a Taxonomy
    '#default_value' =&gt; $default,
    '#required' =&gt; TRUE,
    '#attributes' =&gt; array(
      'class' =&gt; array('clearfix'),
      'onkeypress' =&gt; array(
        'if(event.keyCode==13){this.form.submit();}'
      ),
    ),
    '#ajax' =&gt;  array(
    'callback' =&gt; '_type_ajax_callback',                    
    ),
  );

  $default_2 = isset($input_2) ? $input_2 : key($type_2);
  $form['step_2']['options']['type_2'] = array (
    '#title' =&gt; t('Types 2'),
    '#type' =&gt; 'radios',
    '#options' =&gt; $type_2, //get the array of the Taxonomy which is referenced in the 1st Taxonomy
    '#default_value' =&gt; $default_2,
    '#attributes' =&gt; array(
      'class' =&gt; array('clearfix')
    ),
    '#ajax' =&gt; array(
      'event' =&gt; 'change',
      'wrapper' =&gt; 'calc-wrapper',
      'callback' =&gt; '_type_2_ajax_callback',
      'method' =&gt; 'replace',
      'keypress' =&gt; TRUE,
    ),
  );

  function _type_ajax_callback(&amp;$form, $form_state) {
    return array(
      '#type' =&gt; 'ajax',
      '#commands' =&gt; array(
        ajax_command_replace("#floor-options", render($form['step_2']['options'])), 
      )
    );
  }


Maybe i need to recreate the $type_2 array, but I didn`k know how i could do this. Need I an extra value recall in the ajax callback?
I found a little solution by clearing the default value after output the form.
unset($form['step_2']['options']['type_2']['#default_value']);

But if the user goes back in the multistep form and comes to this point the default value isn`t set. It will not be recrate like the #options in the form array.