I've been trying to ajaxify the node creation form, the purpose?
- Save the node and remains in the node creation page (Done)
- If the user clicks the save button again save a new node
The second point is not working yet because once the Ajax request is sent again the previous created node is updated.
I tried with:
function saveAjaxForm(&$form, FormStateInterface $form_state) {
$response = new AjaxResponse();
$response->addCommand(new AlertCommand('Saved'));
return $response;
}
It works, but other #submit callbacks in the form aren't called again.
How can I "execute again" all the submit functions in the form?
$response->addCommand(new UpdateBuildIdCommand($old_form_build_id, $new_form_build_id));
it solves the issue – anacona16 Oct 3 '19 at 2:46