How to declare proper function to clear form data?

The docs show how to add buttons but they do nothing. Can someone show how a form is cleared?

1 Like

Hi @RichardVencu,

I’m not sure I have the full context on what you are trying to achieve here, but have you added an onSubmit handler to the form?

These docs have an example, have you seen this?
https://developer.atlassian.com/platform/forge/ui-kit-components/form/

Let me know how you get on :slight_smile:

Hi. Yes as I replicated the documentation I can submit. However after submitting the form is not getting clear automatically. I need to add code to clear fields values. This is necessary in order to allow the form to be submitted more than once like for customized loging work for instance

Hello everyone. I deal with the same problem - clearing form values after submitting. Has anyone come up with solutions yet?

Hi, from my experiments I got some hack to do that. I noticed from the Admin Panel I created that I can have multiple forms in multiple fragments and I can show one fragment or another based on rules (such as click on a button or another condition that triggers new rendering). Then I noticed when I return to the normal form, the fields are empty. Did not test but my idea is to duplicate the fragment containing the form (duplicate the logic if needed to have unique names) and alternate between states form1-form2 after each submission.
If you try and it works please let me know as well so I can save testing time :slight_smile:

1 Like

Hi @AndrazHostnik,

We’re aware of this problem and are currently exploring a few ways to solve it. We hope to have an update for you in the next quarter :slight_smile:

2 Likes