#states attribute of FORM API? Currently I am using states attribute in my form to show/hide a drodown having days as its value on selecting a parent dropdown value. My working scenerio is that I want to show a dropdown having 31 days if january,march,may.... is selected and to show another dropdown having 30 days as its value when febraury,april,june .... is selected , can some one suggest me how its could be achieved because in usage of #states attribute only one value could be selected.

function sandbox_ajax_dropdown($form, &amp;$form_state) {

$options = array(1 =&gt; t('1 月'), 2 =&gt; t('2 月'), 3 =&gt; t('3 月'), 4 =&gt; t('4 月'), 5 =&gt; t('5 月'), 6 =&gt; t('6 月'), 7 =&gt; t('7 月'), 8 =&gt; t('8 月'), 9 =&gt; t('9 月'), 10 =&gt; t('10 月'), 11 =&gt; t('11 月'), 12 =&gt; t('12 月'),);

$form['state_list'] = array(
    '#type' =&gt; 'select',
    '#title' =&gt; 'Choose A Day First',
    '#options' =&gt; $options
);
$form['illinois_cities'] = array(
    '#type' =&gt; 'select',
    '#description' =&gt; t("Thirty-One Days."),
    '#states' =&gt; array(
        'visible' =&gt; array(
            ':input[name="state_list"]' =&gt; array('value' =&gt; '5'),
        ),
    ),
    '#options' =&gt; array(1 =&gt; t('1'), 2 =&gt; t('2'), 3 =&gt; t('3'), 4 =&gt; t('4'), 5 =&gt; t('5'), 6 =&gt; t('6'), 7 =&gt; t('7'), 8 =&gt; t('8'), 9 =&gt; t('9'), 10 =&gt; t('10'), 11 =&gt; t('11'), 12 =&gt; t('12'),
        13 =&gt; t('13'), 14 =&gt; t('14'), 15 =&gt; t('15'), 16 =&gt; t('16'), 17 =&gt; t('17'), 18 =&gt; t('18'), 19 =&gt; t('19'), 20 =&gt; t('20'), 21 =&gt; t('21'), 22 =&gt; t('22'), 23 =&gt; t('23'), 24 =&gt; t('24'),
        25 =&gt; t('25'), 26 =&gt; t('26'), 27 =&gt; t('27'), 28 =&gt; t('28'), 29 =&gt; t('29'), 30 =&gt; t('30'), 31 =&gt; t('31')),
);

$form['ohio_cities'] = array(
    '#type' =&gt; 'select',
    '#description' =&gt; t("Thirty Days."),
    '#states' =&gt; array(
        'visible' =&gt; array(
            ':input[name="state_list"]' =&gt; array('value' =&gt; '1', '2'),
        ),
    ),
    '#options' =&gt; array(1 =&gt; t('1'), 2 =&gt; t('2'), 3 =&gt; t('3'), 4 =&gt; t('4'), 5 =&gt; t('5'), 6 =&gt; t('6'), 7 =&gt; t('7'), 8 =&gt; t('8'), 9 =&gt; t('9'), 10 =&gt; t('10'), 11 =&gt; t('11'), 12 =&gt; t('12'),
        13 =&gt; t('13'), 14 =&gt; t('14'), 15 =&gt; t('15'), 16 =&gt; t('16'), 17 =&gt; t('17'), 18 =&gt; t('18'), 19 =&gt; t('19'), 20 =&gt; t('20'), 21 =&gt; t('21'), 22 =&gt; t('22'), 23 =&gt; t('23'), 24 =&gt; t('24'),
        25 =&gt; t('25'), 26 =&gt; t('26'), 27 =&gt; t('27'), 28 =&gt; t('28'), 29 =&gt; t('29'), 30 =&gt; t('30'))
);

return $form;


}
Found it !!!!!!!!
The solution is below highlighted.

function modulename_form_alter(&amp;$form, &amp;$form_state, $form_id) {

if ($form_id == 'webform_client_form_14209') {

    $form['submitted']['dob'] = array(
        '#type' =&gt; 'fieldset',
        '#title' =&gt; t('出生日期'),
        '#weight' =&gt; 4,
    );

    $form['submitted']['dob']['dob_month'] = array(
        '#type' =&gt; 'select',
        '#title' =&gt; t('月'),
        '#options' =&gt; array(
            1 =&gt; t('1 月'), 2 =&gt; t('2 月'), 3 =&gt; t('3 月'), 4 =&gt; t('4 月'), 5 =&gt; t('5 月'), 6 =&gt; t('6 月'), 7 =&gt; t('7 月'), 8 =&gt; t('8 月'), 9 =&gt; t('9 月'), 10 =&gt; t('10 月'), 11 =&gt; t('11 月'), 12 =&gt; t('12 月'),
        ),
        '#description' =&gt; t('Select month.'),
        '#required' =&gt; true,
    );

    /* for 31 days */
    $form['submitted']['dob']['dob_day_31'] = array(
        '#type' =&gt; 'select',
        '#title' =&gt; t('日'),
        '#options' =&gt; array(1 =&gt; t('1'), 2 =&gt; t('2'), 3 =&gt; t('3'), 4 =&gt; t('4'), 5 =&gt; t('5'), 6 =&gt; t('6'), 7 =&gt; t('7'), 8 =&gt; t('8'), 9 =&gt; t('9'), 10 =&gt; t('10'), 11 =&gt; t('11'), 12 =&gt; t('12'),
            13 =&gt; t('13'), 14 =&gt; t('14'), 15 =&gt; t('15'), 16 =&gt; t('16'), 17 =&gt; t('17'), 18 =&gt; t('18'), 19 =&gt; t('19'), 20 =&gt; t('20'), 21 =&gt; t('21'), 22 =&gt; t('22'), 23 =&gt; t('23'), 24 =&gt; t('24'),
            25 =&gt; t('25'), 26 =&gt; t('26'), 27 =&gt; t('27'), 28 =&gt; t('28'), 29 =&gt; t('29'), 30 =&gt; t('30'), 31 =&gt; t('31')),
        '#description' =&gt; t("Thirty-One Days."),
        '#required' =&gt; true,
        ***'#states' =&gt; array(
            'visible' =&gt; array(
                ':input[name="submitted[dob][dob_month]"]' =&gt; array(
                    array('value' =&gt; '1'),
                    array('value' =&gt; '3'),
                    array('value' =&gt; '5'),
                    array('value' =&gt; '7'),
                    array('value' =&gt; '8'),
                    array('value' =&gt; '10'),
                    array('value' =&gt; '12'),
                ),
            ),***
        ),
    );

    /* for 30 days */
    $form['submitted']['dob']['dob_day_30'] = array(
        '#type' =&gt; 'select',
        '#title' =&gt; t('日'),
        '#options' =&gt; array(1 =&gt; t('1'), 2 =&gt; t('2'), 3 =&gt; t('3'), 4 =&gt; t('4'), 5 =&gt; t('5'), 6 =&gt; t('6'), 7 =&gt; t('7'), 8 =&gt; t('8'), 9 =&gt; t('9'), 10 =&gt; t('10'), 11 =&gt; t('11'), 12 =&gt; t('12'),
            13 =&gt; t('13'), 14 =&gt; t('14'), 15 =&gt; t('15'), 16 =&gt; t('16'), 17 =&gt; t('17'), 18 =&gt; t('18'), 19 =&gt; t('19'), 20 =&gt; t('20'), 21 =&gt; t('21'), 22 =&gt; t('22'), 23 =&gt; t('23'), 24 =&gt; t('24'),
            25 =&gt; t('25'), 26 =&gt; t('26'), 27 =&gt; t('27'), 28 =&gt; t('28'), 29 =&gt; t('29'), 30 =&gt; t('30')),
        '#description' =&gt; t("Thirty Days."),
        '#required' =&gt; true,
        '#states' =&gt; array(
            'visible' =&gt; array(
                ':input[name="submitted[dob][dob_month]"]' =&gt; array(
                    array('value' =&gt; '2'),
                    array('value' =&gt; '4'),
                    array('value' =&gt; '6'),
                    array('value' =&gt; '9'),
                    array('value' =&gt; '11'),
                ),
            ),
        ),
    );

    $form['submitted']['dob']['dob_year'] = array(
        '#type' =&gt; 'select',
        '#title' =&gt; t('年'),
        '#options' =&gt; array(1 =&gt; t('2013'), 2 =&gt; t('2012'), 3 =&gt; t('2011'), 4 =&gt; t('2010'), 5 =&gt; t('2009'), 6 =&gt; t('2008'), 7 =&gt; t('2007'), 8 =&gt; t('2006'),
            9 =&gt; t('2005'), 10 =&gt; t('2004'), 11 =&gt; t('2003'), 12 =&gt; t('2002'), 13 =&gt; t('2001'), 14 =&gt; t('2000'), 15 =&gt; t('1999'), 16 =&gt; t('1998'), 17 =&gt; t('1997'),
            18 =&gt; t('1996'), 19 =&gt; t('1995'), 20 =&gt; t('1994'), 21 =&gt; t('1993'), 22 =&gt; t('1992'), 23 =&gt; t('1991'), 24 =&gt; t('1990'), 25 =&gt; t('1989'), 26 =&gt; t('1988'),
            27 =&gt; t('1987'), 28 =&gt; t('1986'), 29 =&gt; t('1985'), 30 =&gt; t('1984'), 31 =&gt; t('1983'),
        ),
        '#description' =&gt; t('Select year.'),
        '#required' =&gt; true,
    );
}
return $form;


}