I have a form that receives node information and then sends an email, all perfect. But what I need now is that once the user sends the form, the page is not refreshed, the form is deleted and replaced by a message that says “thank you for your message”, I also need that the form data keeps arriving to the server.
I have an idea of how to get the form deleted and put the message I want, I can do it with javascript. But I don’t know how to make the page not refresh and the form data arrive to the backend; I was thinking to do it with AJAX, using fetch or XMLHttpRequest.
I’m working with Node and Express.
I need some help, I appreciate any kind of suggestion or contribution.