Salvar e limpar formulário para novo envio

I have a form with a save button pointing to an external link and I want to create the following process:

  1. When clicking on the save button, a message “Data Saved” will be displayed
  2. After closing the message, return to the form
  3. Clear the form for filling again

Can you help this stranger?filled in for a new submission.


Here is my site Read-Only: LINK
(how to share your site Read-Only link)

Hi Noob, here’s how to build it-

  • In javascript, capture your form submit event, have it prevent the default action, and submit your form to your external action URL
  • Capture the response and determine whether the form submission was successful
  • On success, reset all of the fields in your form

That’s it. Details will depend on your webhook design, i.e. how it accepts and returns data, and on your form design for the reset piece.

You can likely use chatGPT to do the code writing with the recipe above, but you’ll need to give it your form details as well if you want it to generate the specifics.

Another approach that might work is to use the HTMX library, which is designed to simplify client-server interactions.