*/
public function dateCallback($form, FormStateInterface $form_state) {
$response = new AjaxResponse();
- $response->addCommand(new HtmlCommand('#ajax_date_value', $form_state->getValue('date')));
+ $date = $form_state->getValue('date');
+ $response->addCommand(new HtmlCommand('#ajax_date_value', sprintf('<div>%s</div>', $date)));
$response->addCommand(new DataCommand('#ajax_date_value', 'form_state_value_date', $form_state->getValue('date')));
return $response;
}
$datetime = $form_state->getValue('datetime')['date'] . ' ' . $form_state->getValue('datetime')['time'];
$response = new AjaxResponse();
- $response->addCommand(new HtmlCommand('#ajax_datetime_value', $datetime));
+ $response->addCommand(new HtmlCommand('#ajax_datetime_value', sprintf('<div>%s</div>', $datetime)));
$response->addCommand(new DataCommand('#ajax_datetime_value', 'form_state_value_datetime', $datetime));
return $response;
}