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(&$form, &$form_state, $form_id) {
if ($form_id == 'testtype_node_form' && arg(1) == 'add' ) {
$form['field_two']['#access'] = 0;
}
if ($form_id == 'testtype_node_form' && arg(2) == 'edit' ) {
$form['field_one']['#access'] = 0;
}
}
Good work!
form_alter
– apasajja Feb 24 '13 at 19:59node/add/testtype
, while node editnode/<nodeid>/edit
. I've solved the problem byform_alter
– apasajja Feb 25 '13 at 3:31