I will talk in general terms because you want something that is not a ready-made standard.
At this time, after the request, Symfony flash messages appear, they are in this way, and to save it you need to find an alternative, assign an ajax call.
You need to invoke the script action with an ajax request, serialize the form data, return the message, and then display it in the way you like.
I used http://jquery.bassistance.de/message/demo/ along with this sample jquery call in some projects, it works well:
$.post("/product/saveAjax", { $("#product").serialize() }, function(data){ $().message(data.message); }, "json");
The return from saving the element using ajax is different, in this case I encode the data using JSON, so if you want to perform other actions, you can enter more variables into the JSON array by manipulating them inside the function (data) {...}
Hope that helps
Guilherme viebig
source share