How to reset form values when Ajax submits? I develop a module which converts submit in the form to Ajax submit (e.g. node/add/article). After every submit, the node is successfully created, but all the values remain saved.

In the Ajax callback, I added a return $form to reload the form after submission, but all fields are empty, not filled with old values.

What shall I do?
You can try the code below

$response-&gt;addCommand(new InvokeCommand('#form-id','trigger',['reset']));



  The 'invoke' command will instruct the client to invoke the given jQuery method with the supplied arguments on the elements matched by the given selector. Intended for simple jQuery commands, such as attr(), addClass(), removeClass(), toggleClass(), etc.


This command is implemented by Drupal.AjaxCommands.prototype.invoke() defined in misc/ajax.js

Please see InvokeCommand