How to make specific field disabled on node submit, but enabled on node edit? In content type testtype I have 2 required field: field_one &amp; field_two.

I need to make field_one only enabled on node submit, while field_two only enabled on node edit.

So, when submitting, we can only see field_one, and when editing, we can only see field_two
you can solve this problem in different ways.

The first is quite easy: you can show/hide the fields from CSS.

When you create a node, the default body classes contain this CSS class: "page-node-add". Instead when you edit a node you'll have the class "page-node-edit".

So you can add this CSS code:

.page-node-add .field_two{ display:none } 
.page-node-edit .field_one{ display:none } 


This solution is not elegant and it could be a potential security hole.

A better solution is to implement hook_form_alter() from your theme or from a custom module.

The code could be something like:

function yourmodulename_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  if ($form_id == 'testtype_node_form' &amp;&amp; arg(1) == 'add' ) {
    $form['field_two']['#access'] = 0;
  }
  if ($form_id == 'testtype_node_form' &amp;&amp; arg(2) == 'edit' ) {
    $form['field_one']['#access'] = 0;
  }
}


Good work!