I have a node form in Drupal 7, in order to simplify it for the user I want to break it up into sections using the vertical tabs feature.
Using hook_form_FORMID_alter() I can move the fields with difficulty.tha following is my code.:
function mymodule_form_alter(&$form, &$form_state, $form_id) {
if ($form_id == 'test_node_form') {
$form['cpmonth'] = array(
'#type' => 'fieldset',
'#title' => t('test'),
'#weight' => 5,
'#collapsible' => TRUE,
);
$form['cpmonth']['field-14sq']=array();
$form['cpmonth']['field-510sq']=array();
}
}
"field-14sq" and "field-510sq" are my input text fields. Do you have any idea?