Using ajax submit option at form submit will stop reloading the page at the time of submission. Thus, to reload the values of field at submit will require
$ajax_response->addCommand(new HtmlCommand('#edit-field-name--description','your value'));
Sample code for this is -
$form['custom_num'] = array(
'#type' => 'textfield',
'#description' => 'Enter a number',
'#size' => 80,
'#maxlength' => 250,
);
$form['calculate'] = array(
'#type' => 'submit',
'#value' => 'Check',
'#ajax' => array(
'callback' => '::submitForm',
'event' => 'click',
'effect' => 'fade',)
);
public function submitForm(array &$form, FormStateInterface $form_state) {
$ajax_response = new AjaxResponse();
if ($form_state->getValue('custom_num') < 0) {
$text = 'Negative Number';
} else {
$text = 'Positive Number';
}
$ajax_response->addCommand(new HtmlCommand('#edit-custom-num--description', $text));
return $ajax_response;
}