How to add 'not equal' condition in form #states In my form, there are 3 selection list  A, B and C.

I wanna show or hide C based on values of A and B selected.
C should be shown if A's value = 'all and B's value != 'all'

How to set the #state condition in this case?

 $form['C'] = array(
        '#type' =&gt; 'select',
        '#title' =&gt; t('C'),
        '#states' =&gt; array(
            'visible' =&gt; array(
                ':input[name="A"]' =&gt; array('value' =&gt; 'all'),
                ':input[name="B"]' =&gt; array('value' =&gt; 'all') //???how to set !='all' here?
            )
        )
)
This code should work:

':input[name="B"]' =&gt; array('!value' =&gt; 'all')