1

Does anyone know if there is a way to set the value of a field with states?

E.g. If "this" is checked, set input value to "0"

Something like....

$form['booking_process'] = array(
        '#type' => 'textfield',
        '#states' => array(
            'value["0"]' => array(
                'select[name="field_relation[und]"]' => array('checked' => true),
            ),
        ),
    );

I always do this with my own JS, just wondered if there was a feature in states I was missing?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.