If we used #disabled & #states with disabled option on same element, then #states with disabled getting priority over form api #disabled. Which results in client side the field is not showing disabled.
$form['name'] = array(
'#type' => 'textfield',
'#title' => t('Name'),
'#states' => array(
'disabled' => array(':input[name = "xyz"]' => array('checked' => TRUE ), ),
),
'#disabled' => TRUE ,
'#default_value' => 'me',
);
I have checked on server side the default value what i set is get after submit. This means even you changed the form value it will not get on server side. It works as per form API. Problem is on client side only.
Comments
Comment #1
amar.deokar commented