How to set an AJAX callback for my drop down list select in my form? I am about to create a filter views handler extended from views_handler_filter_string
(you can see the class under views/handlers), so I have to override my method value_form to create a new value form form my filter handler.

function value_form(&amp;$form, &amp;$form_state) {
    $countries = _prepare_countries_list();
    $selected_country = isset($form_state['values']['value']['country'])?$form_state['values']['value']['country']:key($countries);

    $values = array(
        'country' =&gt; array(
            '#type'    =&gt; 'select',
            '#title'   =&gt; t('Country'),
            '#options' =&gt;$countries,
            '#ajax'    =&gt; array(
                'callback' =&gt; 'country_state_dependent_dropdown_callback',
                'wrapper'  =&gt; 'dropdown-states',
            ),
        ),
        'state' =&gt; array(
            '#type'    =&gt; 'select',
            '#title'   =&gt; t('State'),
            '#prefix' =&gt; '&lt;div id="dropdown-states"&gt;',
            '#suffix' =&gt; '&lt;/div&gt;',
            '#options' =&gt; _country_state_get_second_dropdown_options($selected_country),
        ),
    );
    $form['value'] = $values;
    return $form;
}


I am trying here to set an ajax callback for my drop down list select. Usually we implement our callback function and we return $form['element'], but in my case it gives no result.

Anyone who has tried to override the value_form before to add some AJAX able to help me resolve this issue?
This is untested but at least, you get the logic. I'm sorry if I edited your coding style convention.

function value_form(&amp;$form, &amp;$form_state)
{
    $form = array();

    $countries = _prepare_countries_list();
    $selected_country = isset($form_state['values']['country'])?$form_state['values']['country']:key($countries);

    // Country dropdown list
    $form['country'] = array(
        '#title' =&gt; t('Country'),
        '#type' =&gt; 'select',
        '#options' =&gt; $countries,
        '#ajax' =&gt; array(
            'event'=&gt;'change',
            'callback' =&gt;'country_state_dependent_dropdown_callback',
            'wrapper' =&gt; 'dropdown-states',
        ),
    ); 

    // Wrapper for state dropdown list
    $form['state_wrapper'] = array(
        '#prefix' =&gt; '&lt;div id="dropdown-states"&gt;',
        '#suffix' =&gt; '&lt;/div&gt;',
    ); 


    // State dropdown list
    $form['state_wrapper']['state'] = array(
        '#title' =&gt; t('State'),
        '#type' =&gt; 'select',
        '#options' =&gt; _country_state_get_second_dropdown_options($selected_country),
    ); 

    return $form;
}


/**
* Function for handling ajax request
*/
function country_state_dependent_dropdown_callback($form, $form_state){
    return $form['state_wrapper'];
}