In order to hide certain fileds from form in drupal
function hook_form_alter(&$form, &$form_state, $form_id)
{
if ($form['form_id']['#id'] == 'fomr-id')
{
$form['field_yourfield']['#access'] = FALSE;
// if you want it to be visible, but disabled then:
$form['field_yourfield']['#disabled'] = TRUE;
}
}
0 Comment(s)