Hide text field in hook_form_alter I have a field field_agent_name. I want to hide this field in my custom module using hook_form_alter. 

How to do this.
Using the hook_form_FORM_ID_alter format is ideal:

function MODULENAME_form_CONTENTTYPE_node_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  $form['field_agent_name']['#access'] = FALSE;
}


More info on hook_form_FORM_ID_alter