How to refresh a custom form after submission?

If you add a dataset to the page you can add a submit button linked to the dataset when the button is pressed the fields related to the dataset will empty and the data will be written to the database. Otherwise you will probably have to call a function to set the fields to empty like the previous poster suggested.