How to transfer data from the program's created field to the standard text, while saving the node?

03/07/2018


using hook_form_alter I created 4 INPUT I want while saving node to extract data from them and transferred to a standard field.
Using foreach, I can form a string
and then transfer it to the standard field.

But how to get the data from the INPUT, while saving material?

I use hook_node_presave ($ node) but it takes as its argument already $node, in which there are no custom fields, I do not know how to transfer them here and already work with node_presave

$form['field_cadastral_num'] = array(
    '#type' => 'fieldset',
    '#title' => 'test',
    '#attributes' => array(
        'class' => array(
            'field-type-text',
            'field-name-property_node_form'
        ),
    ),
  '#weight' => $instance['widget']['weight'],
);  
$form['field_cadastral_num']['cell'][] = array(
  '#type' => 'textfield',  
  '#default_value' => '', 
  '#size' => 3, 
  '#maxlength' => 3,
  '#name' => 'kadastr[0]',
  '#value' => ''
);
$form['field_cadastral_num']['cell'][] = array(
  '#type' => 'textfield',  
  '#default_value' => '', 
  '#size' => 3, 
  '#delta' => 3, 
  '#maxlength' => 3,
  '#name' => 'kadastr[1]',
  '#value' => '',
  '#prefix' => ':'
);  
$form['field_cadastral_num']['cell'][] = array(
  '#type' => 'textfield',  
  '#default_value' => '', 
  '#size' => 6, 
  '#maxlength' => 6,
  '#name' => 'kadastr[2]',
  '#value' => '',
  '#prefix' => ':'
);
$form['field_cadastral_num']['cell'][] = array(
  '#type' => 'textfield',  
  '#default_value' => '', 
  '#size' => 3, 
  '#maxlength' => 3,
  '#name' => 'kadastr[3]',
  '#value' => '',
  '#prefix' => ':'
);  

قالب وردپرس