Setting field attribute as read only in hook_form_alter?
You can use the #disabled attribute:

function mymodule_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  if ($form_id == 'nodetitle_node_form' &amp;&amp; $form['nid']['#value']) {
    $form['title']['#disabled'] = TRUE;
  }
}


I made the assumption that you want this when editing nodes only (not when they are being added) which is what the &amp;&amp; $form['nid']['#value'] part is for.