Could you please help me with the following task? I need to make the existing field (name Clarify, type select - "clarification required/clarification isn't required") to be editable from display view (not on the Edit tab) and I need to place this field next to Comment field (see the screenshot).
I'm trying to use hook_alter_form in the following way, but with no luck. I know the below code is wrong and I need a little help to know which way to go.
function custom_form_alter(&$form, $form_state, $form_id) {
if ($form_id == 'comment_node_support_ticket_form') {
$form['field_clarify'] = array(
'#type' => 'select',
'#title' => 'Clarify',
);
$form['#validate'][] = 'custom_support_comment_submit';
}
}
function custom_support_comment_submit($form, &$form_state) {
$node = node_load($form_state['values']['nid']);
$node_wrapper = entity_metadata_wrapper('node', $node);
$node_wrapper->field_clarify->set($form_state['values']['field_clarify']);
$node_wrapper->save();
}