I have a form which has a select with a
#default_value which get's set when the user has errors/has filled out the form. Then I have two fields with a
#states that show them when the select has a value.
$checkout_form['wrap'] = array( '#type' => 'select', '#title' => t('How many item(s) do you wish to have wrapped?'), '#default_value' => $default_giftwrap_amount, );
Then I have a fieldset and a textarea with
'#states' => array( 'visible' => array( ':input[name="wrapping[wrap]"]' => array('!value' => ''), ), ),
which make those two fields show when ever something is selected.
But my problem is when the
#default_value is say 400 (ie something is selected) it doesn't show the fieldset and textarea, only when you select something.
Is there anyway for it to check on page load as well as onchange?