Dropdown whose options are dependent on a choice made in a previous dropdown I have two taxonomies (class type and level). I load one in drop-down (class type) and another depended on result of choice (level).

I handle lot of cases (when choice class type load level ) &amp;&amp; (if level have data and class type load it when first load) but when I choice empty class type load default data of level :(

function ria_form_alter(&amp;$form, &amp;$form_state, $form_id) {
        $classTypeSelected = false;
        // load class type fron taxonamy                
        $classTypes = Utilities::LoadTaxonamy ( 'class_type' );
        $form ['field_level'] ['und'] ['#prefix'] = '&lt;div id="dropdown-second-replace"&gt;';
        $form ['field_level'] ['und'] ['#suffix'] = '&lt;/div&gt;';
//dpm($form_state ['values'] ['field_class_type'] ['und'] [0] ['tid']);
        if ( isset($form_state ['values'] ['field_class_type'] ['und'] [0] ['tid'] )) { 
            $classTypeSelected = $form_state ['values'] ['field_class_type'] ['und'] [0] ['tid'];
        }  else {
            $classTypeSelected = false;
        }

        $form ['field_level'] ['und'] ['#options'] = load_level ( $classTypeSelected );
        $form ['field_level'] ['und'] ['#default_value'] = isset ( $form_state ['field_level'] ['und'] ['#default_value'] [0] ) ? $form_state ['field_level'] ['und'] ['#default_value'] [0] : '';
        $form ['field_class_type'] ['und'] ['#ajax'] = array (
                'callback' =&gt; 'ajax_example_dependent_dropdown_callback',
                'wrapper' =&gt; 'dropdown-second-replace' 
        );

    }


function ajax_example_dependent_dropdown_callback($form, $form_state) {
    return $form ['field_level'] ['und'];
}



function load_level($class_type) {
    $levels = array ();
    if ($class_type &amp;&amp; $class_type != '_none') {
        $levels = Utilities::DataFromTaxonamy ( $class_type );
    }
    return $levels;
}
Maybe you should consider using thee Reference field option limit module to implement what you're trying to do. Here is a quote from its project page:

... allows reference fields of several types to have their widgets' available options limited by the values of other fields in the current entity.

Here is an example of how to use this module (also from its project page):

Suppose you want to label articles (or products, or businesses, etc) by both city and country so both can be used for filtering and searching. You could use a hierarchical taxonomy with city terms as children of country terms, but that doesn't make sense when you come to set up Views filters.
With this module, create two separate taxonomies for country and city (or content types, or whatever entity you want to use). Then add a reference field so that each city points to its country: eg, the term 'Paris' has a reference to 'France'.
Then when editing an article, selecting 'France' in the country field will cause the city field to update to show only cities in France.